AlenkaF commented on code in PR #51161:
URL: https://github.com/apache/arrow/pull/51161#discussion_r4563593465


##########
python/pyarrow/tests/test_misc.py:
##########
@@ -290,3 +292,28 @@ 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](("module", "construct", "message"), [
+    pytest.param(
+        "acero", lambda mod: mod.ScanNodeOptions(None), "Argument 'dataset'",
+        marks=[pytest.mark.acero, pytest.mark.dataset], id="scan"),
+    pytest.param(
+        "acero", lambda mod: mod.ProjectNodeOptions([None]),
+        "Expression must not be None", marks=pytest.mark.acero, id="project"),
+    pytest.param(
+        "parquet", lambda mod: mod.ParquetSchema(None), "Argument 'container'",
+        marks=pytest.mark.parquet, id="parquet-schema"),
+    pytest.param(
+        "parquet", lambda mod: mod.ColumnSchema(None, 0), "Argument 'schema'",
+        marks=pytest.mark.parquet, id="column-schema"),
+    pytest.param(
+        "fs", lambda mod: mod.SubTreeFileSystem("", None), "Argument 
'base_fs'",
+        id="subtree"),
+])
+def test_required_arrow_objects_reject_none_without_crashing(

Review Comment:
   Please drop the parametrization from test_misc.py and instead add each check 
as plain `pytest.raises` lines in its module's own test file (test_acero.py, 
parquet/test_metadata.py, test_fs.py), like the rest of this PR does. That 
removes the need for the `importorskip`/lambda indirection and the extra 
`Callable`/`ModuleType` imports.



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