Skip to content

Commit ef48dd9

Browse files
timsaucerclaude
andcommitted
Merge test_array_any_value into parametrized test_any_value_aliases
Use the richer multi-row dataset (including all-nulls case) for both array_any_value and list_any_value via the parametrized test. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b4b8775 commit ef48dd9

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

python/tests/test_functions.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,24 +1507,17 @@ def test_coalesce(df):
15071507
)
15081508

15091509

1510-
def test_array_any_value():
1510+
@pytest.mark.parametrize("func", [f.array_any_value, f.list_any_value])
1511+
def test_any_value_aliases(func):
15111512
ctx = SessionContext()
15121513
df = ctx.from_pydict({"a": [[None, 2, 3], [None, None, None], [1, 2, 3]]})
1513-
result = df.select(f.array_any_value(column("a")).alias("v")).collect()
1514+
result = df.select(func(column("a")).alias("v")).collect()
15141515
values = [row.as_py() for row in result[0].column(0)]
15151516
assert values[0] == 2
15161517
assert values[1] is None
15171518
assert values[2] == 1
15181519

15191520

1520-
@pytest.mark.parametrize("func", [f.array_any_value, f.list_any_value])
1521-
def test_any_value_aliases(func):
1522-
ctx = SessionContext()
1523-
df = ctx.from_pydict({"a": [[None, 5]]})
1524-
result = df.select(func(column("a")).alias("v")).collect()
1525-
assert result[0].column(0)[0].as_py() == 5
1526-
1527-
15281521
@pytest.mark.parametrize("func", [f.array_distance, f.list_distance])
15291522
def test_array_distance_aliases(func):
15301523
ctx = SessionContext()

0 commit comments

Comments
 (0)