Copilot commented on code in PR #154:
URL: https://github.com/apache/fluss-rust/pull/154#discussion_r2694931804
##########
bindings/python/example/example.py:
##########
@@ -175,6 +175,27 @@ async def main():
# TODO: support to_duckdb()
+ # Test the new poll() method for incremental reading
+ print("\n--- Testing poll() method ---")
Review Comment:
The example calls `subscribe()` again before polling, but there's no
explanation of why this is necessary or whether it resets the scanner state.
Consider adding a comment explaining this step, similar to line 163 which says
'# Reset subscription'.
```suggestion
print("\n--- Testing poll() method ---")
# Reset subscription before polling to ensure we start from a known
position
```
##########
bindings/python/src/table.rs:
##########
@@ -321,6 +322,59 @@ impl LogScanner {
Ok(df)
}
+ /// Poll for new records with the specified timeout
+ ///
+ /// Args:
+ /// timeout_ms: Timeout in milliseconds to wait for records
+ ///
+ /// Returns:
+ /// PyArrow Table containing the polled records
+ ///
+ /// Note:
+ /// - Returns an empty table (with correct schema) if no records are
available
+ /// - When timeout expires, returns an empty table (NOT an error)
+ fn poll(&self, py: Python, timeout_ms: i64) -> PyResult<Py<PyAny>> {
+ use std::time::Duration;
Review Comment:
The `use std::time::Duration` import is redundant. The `Duration` type is
already used in the `to_arrow()` method at line 253 without a local import,
suggesting it's available in scope. Consider removing this redundant import for
consistency.
--
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]