QuakeWang commented on code in PR #428:
URL: https://github.com/apache/paimon-rust/pull/428#discussion_r3505258086


##########
bindings/python/src/read.rs:
##########
@@ -114,6 +155,39 @@ impl PyTableScan {
     }
 }
 
+#[pyclass(name = "TableRead", module = "pypaimon_rust.datafusion")]
+pub struct PyTableRead {
+    table: Arc<Table>,
+    projection: Option<Vec<String>>,
+    limit: Option<usize>,
+    filter: Option<Predicate>,
+}
+
+#[pymethods]
+impl PyTableRead {
+    /// Read the given splits into a list of PyArrow RecordBatches.
+    fn read(&self, py: Python<'_>, splits: &Bound<'_, PyAny>) -> 
PyResult<Vec<Py<PyAny>>> {
+        let splits = extract_splits(splits)?;
+        if splits.is_empty() {

Review Comment:
   this empty-splits fast path skips `ReadBuilder::new_read()` validation, so 
invalid projections can return `[]` only when no splits are passed. Consider 
constructing `read` before this return to keep validation consistent.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to