Repository navigation
Conversation
|
|
|
|
|
Hi, the workflows on this PR are still showing action_required, so CI has not run yet. Could a committer approve the runs? |
raulcd
left a comment
There was a problem hiding this comment.
Thanks for the fix. Sorry we are slightly overwhelmed by bot PRs. I am running CI and will merge if no CI issues.
raulcd
left a comment
There was a problem hiding this comment.
The linter failure is related. Could you run pre-commit locally? See:
https://arrow.apache.org/docs/developers/python/development.html#coding-style
|
If you can also rebase with latest main will help solve the CI failures which have been fixed already. |
Rationale for this change
Passing a negative value to
Dataset.head()can result in unexpected behavior, including returning a table with a negative number of rows.Since the
head()API expects a non-negative number of rows, negative values should be rejected explicitly with a clear error message.What changes are included in this PR?
AsyncScanner::Head()to reject negativenum_rowsvalues.Status::Invalid("num_rows must be non-negative")when a negative value is provided.Dataset.head()Scanner.head()Fragment.head()Are these changes tested?
Yes.
python/pyarrow/tests/test_dataset.pytest suite: 310 passed, 54 skipped.git diff --checkpassed.Are there any user-facing changes?
Yes. Calling
Dataset.head(),Scanner.head(), orFragment.head()with a negativenum_rowsnow raisespyarrow.ArrowInvalidwith a clear error message instead of producing unexpected behavior.Was AI used for this PR?
PR code and description written by:
Reviewed before submission by: