Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-37650: [Python] Check filter inputs in FilterMetaFunction #38075

Merged
merged 5 commits into from
Oct 10, 2023
Merged

GH-37650: [Python] Check filter inputs in FilterMetaFunction #38075

merged 5 commits into from
Oct 10, 2023

Conversation

p-a-a-a-trick
Copy link
Contributor

@p-a-a-a-trick p-a-a-a-trick commented Oct 6, 2023

Rationale for this change

Prevent a segfault upon passing a non-(chunked_)array object into Table.filter. See #37650.

What changes are included in this PR?

  1. Check filter Datum kind to make sure that it is an array or a chunked array
  2. test that attempting to filter a table with another table raises a not implemented error

Are these changes tested?

In PyArrow, yes

Are there any user-facing changes?

Raises an error if a non-array or non-chunked_array object is passed into Table.filter

@github-actions
Copy link

github-actions bot commented Oct 6, 2023

⚠️ GitHub issue #37650 has been automatically assigned in GitHub to PR creator.

@p-a-a-a-trick
Copy link
Contributor Author

@github-actions autotune

Copy link
Member

@pitrou pitrou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for noticing this. The fix LGTM on the principle, just two minor suggestions.

python/pyarrow/tests/test_table.py Outdated Show resolved Hide resolved
@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Oct 9, 2023
Copy link
Member

@pitrou pitrou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, thank you @p-a-a-a-trick . I fixed the C++ formatting and improved the test slightly.

@pitrou
Copy link
Member

pitrou commented Oct 10, 2023

CI failures are unrelated.

@pitrou pitrou merged commit 11d5ab6 into apache:main Oct 10, 2023
33 of 35 checks passed
@pitrou pitrou removed the awaiting committer review Awaiting committer review label Oct 10, 2023
@conbench-apache-arrow
Copy link

After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit 11d5ab6.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 22 possible false positives for unstable benchmarks that are known to sometimes produce them.

JerAguilon pushed a commit to JerAguilon/arrow that referenced this pull request Oct 23, 2023
…pache#38075)

### Rationale for this change
Prevent a segfault upon passing a non-(chunked_)array object into `Table.filter`. See apache#37650.

### What changes are included in this PR?
1. Check filter Datum kind to make sure that it is an array or a chunked array
2. test that attempting to filter a table with another table raises a not implemented error

### Are these changes tested?
In PyArrow, yes

### Are there any user-facing changes?
Raises an error if a non-array or non-chunked_array object is passed into `Table.filter`

* Closes: apache#37650

Lead-authored-by: Patrick Clarke <prclarke@protonmail.com>
Co-authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Antoine Pitrou <antoine@python.org>
loicalleyne pushed a commit to loicalleyne/arrow that referenced this pull request Nov 13, 2023
…pache#38075)

### Rationale for this change
Prevent a segfault upon passing a non-(chunked_)array object into `Table.filter`. See apache#37650.

### What changes are included in this PR?
1. Check filter Datum kind to make sure that it is an array or a chunked array
2. test that attempting to filter a table with another table raises a not implemented error

### Are these changes tested?
In PyArrow, yes

### Are there any user-facing changes?
Raises an error if a non-array or non-chunked_array object is passed into `Table.filter`

* Closes: apache#37650

Lead-authored-by: Patrick Clarke <prclarke@protonmail.com>
Co-authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Antoine Pitrou <antoine@python.org>
dgreiss pushed a commit to dgreiss/arrow that referenced this pull request Feb 19, 2024
…pache#38075)

### Rationale for this change
Prevent a segfault upon passing a non-(chunked_)array object into `Table.filter`. See apache#37650.

### What changes are included in this PR?
1. Check filter Datum kind to make sure that it is an array or a chunked array
2. test that attempting to filter a table with another table raises a not implemented error

### Are these changes tested?
In PyArrow, yes

### Are there any user-facing changes?
Raises an error if a non-array or non-chunked_array object is passed into `Table.filter`

* Closes: apache#37650

Lead-authored-by: Patrick Clarke <prclarke@protonmail.com>
Co-authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Antoine Pitrou <antoine@python.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Python] Passing table as argument to pyarrow.Table.filter causes segfault
2 participants