Repository navigation
feat(pyo3): expose statement row limit - #269
Conversation
Signed-off-by: Vu Anh Phung <vu.phung@databricks.com>
There was a problem hiding this comment.
Verdict: 1 Medium
Looks good overall — the PyO3 set_row_limit is a clean, correctly-documented passthrough to the well-tested kernel StatementSpec::row_limit(Option<i64>), with Python surface + live coverage added. One medium concern: the row_limit=0 live-test expectation may diverge from Databricks' documented "0 = no limit" semantics (see inline).
Signed-off-by: Vu Anh Phung <vu.phung@databricks.com>
Signed-off-by: Vu Anh Phung <vu.phung@databricks.com>
There was a problem hiding this comment.
Verdict: 1 Low
Looks good — a clean, correct forwarding of set_row_limit that mirrors the existing set_sql setter and the well-documented kernel StatementSpec::row_limit semantics, with both surface and live test coverage. One low note about the unvalidated/untested negative-and-zero boundary.
| } | ||
|
|
||
| /// Set the server-side row cap for this statement. ``None`` clears it. | ||
| fn set_row_limit(&mut self, row_limit: Option<i64>) -> PyResult<()> { |
There was a problem hiding this comment.
🔵 Low — set_row_limit forwards any i64 through unchecked, including negative values (e.g. -1) and 0. Unlike bind_param, which deliberately rejects out-of-range ordinals client-side to surface a typed KernelError(InvalidArgument) rather than a wire-level rejection, both the kernel StatementSpec::row_limit and this binding accept negatives and defer to the SEA server. That's arguably consistent with the kernel's own (non-validating) contract, so this is not a correctness bug — but the live test only covers None, 1, 5, leaving the negative/0 boundary behavior unspecified and untested. Consider either documenting that out-of-range values are the server's responsibility, or asserting the boundary (e.g. that 0/negative raises) so the contract is pinned. Non-blocking.
Exposes
Statement.set_row_limit(...)in the Python binding and forwards it to the existing kernelStatementSpecrow limit. This lets Python clients apply the limit in the SEA request instead of truncating results locally.Adds Python surface coverage and an opt-in live behavior test for
None,1, and5. Unblocks PECOBLR-4127.Validated with PyO3 cargo tests, formatting, and the core row-limit wire test.