Copilot commented on code in PR #51294:
URL: https://github.com/apache/arrow/pull/51294#discussion_r4528744910
##########
python/pyarrow/tests/test_misc.py:
##########
@@ -290,3 +290,21 @@ def test_extension_type_constructor_errors(klass):
msg = f"Do not call {klass.__name__}'s constructor directly, use .*
instead."
with pytest.raises(TypeError, match=msg):
klass()
+
+
[email protected]
[email protected]
[email protected](("call", "argument"), [
+ ("ds.get_partition_keys(None)", "partition_expression"),
+ ("ds.field('a').equals(None)", "other"),
+])
+def test_expression_apis_reject_none_without_crashing(
+ call: str, argument: str) -> None:
+ code = f"""if 1:
+ import pytest
+ import pyarrow.dataset as ds
Review Comment:
The subprocess regression test’s second case uses
`ds.field('a').equals(None)`, but the PR description (and the reported crash)
refers to `pyarrow.compute.field('a').equals(None)`. Using `dataset.field` here
may not exercise the intended public API entry point. Consider switching the
second parametrized `call` to `pc.field('a').equals(None)` and importing
`pyarrow.compute as pc` in the subprocess code.
##########
python/pyarrow/tests/test_misc.py:
##########
@@ -290,3 +290,21 @@ def test_extension_type_constructor_errors(klass):
msg = f"Do not call {klass.__name__}'s constructor directly, use .*
instead."
with pytest.raises(TypeError, match=msg):
klass()
+
+
[email protected]
[email protected]
[email protected](("call", "argument"), [
+ ("ds.get_partition_keys(None)", "partition_expression"),
+ ("ds.field('a').equals(None)", "other"),
+])
Review Comment:
The subprocess regression test’s second case uses
`ds.field('a').equals(None)`, but the PR description (and the reported crash)
refers to `pyarrow.compute.field('a').equals(None)`. Using `dataset.field` here
may not exercise the intended public API entry point. Consider switching the
second parametrized `call` to `pc.field('a').equals(None)` and importing
`pyarrow.compute as pc` in the subprocess code.
--
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]