Skip to content

Commit 54b3c2e

Browse files
committed
Add test for aggregate method with string and expression equivalence
1 parent e69fb9b commit 54b3c2e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

python/tests/test_dataframe.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,14 @@ def test_sort_string_and_expression_equivalent(df):
276276
assert result_str == result_expr
277277

278278

279+
def test_aggregate_string_and_expression_equivalent(df):
280+
from datafusion import col
281+
282+
result_str = df.aggregate("a", [f.count()]).to_pydict()
283+
result_expr = df.aggregate(col("a"), [f.count()]).to_pydict()
284+
assert result_str == result_expr
285+
286+
279287
def test_filter_string_unsupported(df):
280288
with pytest.raises(TypeError, match=r"col\(\) or lit\(\)"):
281289
df.filter("a > 1")

0 commit comments

Comments
 (0)