1fanwang commented on code in PR #51294:
URL: https://github.com/apache/arrow/pull/51294#discussion_r4581469435


##########
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:
   Done in 
https://github.com/1fanwang/arrow/commit/a59f1c69eaa0364b9fc02dd43f74a4772640fc1b.



##########
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:
   Done in 
https://github.com/1fanwang/arrow/commit/a59f1c69eaa0364b9fc02dd43f74a4772640fc1b.



-- 
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]

Reply via email to