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

raulcd 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 06b693defc GH-46174: [Python] Failing tests in python minimal builds 
(#46175)
06b693defc is described below

commit 06b693defcd9edfd005fcc4abb20f3cb93ad0e73
Author: Alenka Frim <[email protected]>
AuthorDate: Thu Apr 17 11:42:24 2025 +0200

    GH-46174: [Python] Failing tests in python minimal builds (#46175)
    
    ### Rationale for this change
    
    There are tests failing in builds:
    
    
https://github.com/ursacomputing/crossbow/actions/runs/14504182772/job/40690374094#step:3:15238
    
https://github.com/ursacomputing/crossbow/actions/runs/14504182883/job/40690374677#step:3:13330
    
    ### What changes are included in this PR?
    
    Tests that caused the failure are moved from `test_compute.py` to 
`test_acero.py.`
    
    ### Are these changes tested?
    
    Yes.
    
    ### Are there any user-facing changes?
    
    No, only changes in the tests.
    
    * GitHub Issue: #46174
    
    Authored-by: AlenkaF <[email protected]>
    Signed-off-by: Raúl Cumplido <[email protected]>
---
 python/pyarrow/tests/test_acero.py   | 19 +++++++++++++++++++
 python/pyarrow/tests/test_compute.py | 22 ----------------------
 2 files changed, 19 insertions(+), 22 deletions(-)

diff --git a/python/pyarrow/tests/test_acero.py 
b/python/pyarrow/tests/test_acero.py
index 1bdfabd8f5..6ad20f48b4 100644
--- a/python/pyarrow/tests/test_acero.py
+++ b/python/pyarrow/tests/test_acero.py
@@ -115,6 +115,25 @@ def test_filter(table_source):
         FilterNodeOptions(None)
 
 
[email protected]('source', [
+    pa.record_batch({"number": [1, 2, 3]}),
+    pa.table({"number": [1, 2, 3]})
+])
+def test_filter_all_rows(source):
+    # GH-46057: filtering all rows should return empty RecordBatch with same 
schema
+    result_expr = source.filter(pc.field("number") < 0)
+
+    assert result_expr.num_rows == 0
+    assert type(result_expr) is type(source)
+    assert result_expr.schema.equals(source.schema)
+
+    result_mask = source.filter(pa.array([False, False, False]))
+
+    assert result_mask.num_rows == 0
+    assert type(result_mask) is type(source)
+    assert result_mask.schema.equals(source.schema)
+
+
 def test_project(table_source):
     # default name from expression
     decl = Declaration.from_sequence([
diff --git a/python/pyarrow/tests/test_compute.py 
b/python/pyarrow/tests/test_compute.py
index d186addf91..453bc177d9 100644
--- a/python/pyarrow/tests/test_compute.py
+++ b/python/pyarrow/tests/test_compute.py
@@ -1415,17 +1415,6 @@ def test_filter_record_batch():
     expected = pa.record_batch([pa.array(["a", None, "e"])], names=["a'"])
     assert result.equals(expected)
 
-    # GH-46057: filtering all rows should return empty RecordBatch with same 
schema
-    mask_empty_result = batch.filter(pa.array([False] * batch.num_rows))
-    assert mask_empty_result.num_rows == 0
-    assert isinstance(mask_empty_result, pa.RecordBatch)
-    assert mask_empty_result.schema.equals(batch.schema)
-
-    expr_empty_result = batch.filter(pc.field("a'") == "zzz")
-    assert expr_empty_result.num_rows == 0
-    assert isinstance(expr_empty_result, pa.RecordBatch)
-    assert expr_empty_result.schema.equals(batch.schema)
-
 
 def test_filter_table():
     table = pa.table([pa.array(["a", None, "c", "d", "e"])], names=["a"])
@@ -1445,17 +1434,6 @@ def test_filter_table():
         result = table.filter(mask, null_selection_behavior="emit_null")
         assert result.equals(expected_null)
 
-    # GH-46057: filtering all rows should return empty table with same schema
-    mask_empty_result = table.filter(pa.array([False] * table.num_rows))
-    assert mask_empty_result.num_rows == 0
-    assert isinstance(mask_empty_result, pa.Table)
-    assert mask_empty_result.schema.equals(table.schema)
-
-    expr_empty_result = table.filter(pc.field("a") == "zzz")
-    assert expr_empty_result.num_rows == 0
-    assert isinstance(expr_empty_result, pa.Table)
-    assert expr_empty_result.schema.equals(table.schema)
-
 
 def test_filter_errors():
     arr = pa.chunked_array([["a", None], ["c", "d", "e"]])

Reply via email to