This is an automated email from the ASF dual-hosted git repository.

kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new e0d1f5105b GH-44369: [CI][Python] Remove ds requirement from test 
collection on test_dataset.py (#44370)
e0d1f5105b is described below

commit e0d1f5105ba0dece2b74ed4a2e1530fccd0eef0d
Author: Raúl Cumplido <[email protected]>
AuthorDate: Fri Oct 11 03:01:11 2024 +0200

    GH-44369: [CI][Python] Remove ds requirement from test collection on 
test_dataset.py (#44370)
    
    ### Rationale for this change
    
    If pyarrow has been built without dataset test collection errors due to 
pytest.mark.parametrize requiring dataset.
    
    ### What changes are included in this PR?
    
    Move dataset requirement outside of test collection by removing it from the 
parametrization.
    
    ### Are these changes tested?
    
    Via archery
    
    ### Are there any user-facing changes?
    
    No
    * GitHub Issue: #44369
    
    Authored-by: Raúl Cumplido <[email protected]>
    Signed-off-by: Sutou Kouhei <[email protected]>
---
 python/pyarrow/tests/test_dataset.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/python/pyarrow/tests/test_dataset.py 
b/python/pyarrow/tests/test_dataset.py
index ea6cb88074..0d3a0fbd3b 100644
--- a/python/pyarrow/tests/test_dataset.py
+++ b/python/pyarrow/tests/test_dataset.py
@@ -737,20 +737,20 @@ def test_partitioning_pickling(pickle_module):
 @pytest.mark.parametrize(
     "flavor, expected_defined_partition, expected_undefined_partition",
     [
-        (ds.HivePartitioning, (r"foo=A/bar=ant%20bee", ""), ("", "")),
-        (ds.DirectoryPartitioning, (r"A/ant bee", ""), ("", "")),
-        (ds.FilenamePartitioning, ("", r"A_ant bee_"), ("", "_")),
+        ("HivePartitioning", (r"foo=A/bar=ant%20bee", ""), ("", "")),
+        ("DirectoryPartitioning", (r"A/ant bee", ""), ("", "")),
+        ("FilenamePartitioning", ("", r"A_ant bee_"), ("", "_")),
     ],
 )
 def test_dataset_partitioning_format(
-    flavor: "ds.Partitioning",
+    flavor: str,
     expected_defined_partition: tuple,
     expected_undefined_partition: tuple,
 ):
 
     partitioning_schema = pa.schema([("foo", pa.string()), ("bar", 
pa.string())])
 
-    partitioning = flavor(schema=partitioning_schema)
+    partitioning = getattr(ds, flavor)(schema=partitioning_schema)
 
     # test forward transformation (format)
     assert (
@@ -782,7 +782,7 @@ def test_dataset_partitioning_format(
         == expected_undefined_partition
     )
 
-    if flavor != ds.HivePartitioning:
+    if flavor != "HivePartitioning":
         # Raises error upon filtering for lower level partition without 
filtering for
         # higher level partition
         with pytest.raises(

Reply via email to