Skip to content

Commit 99b45ff

Browse files
committed
Add tests for sorting and filtering with string expressions in DataFrame
1 parent 2941710 commit 99b45ff

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

python/tests/test_dataframe.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,19 @@ def test_sort(df):
268268
assert table.to_pydict() == expected
269269

270270

271+
def test_sort_string_and_expression_equivalent(df):
272+
from datafusion import col
273+
274+
result_str = df.sort("a").to_pydict()
275+
result_expr = df.sort(col("a")).to_pydict()
276+
assert result_str == result_expr
277+
278+
279+
def test_filter_string_unsupported(df):
280+
with pytest.raises(AttributeError):
281+
df.filter("a > 1")
282+
283+
271284
def test_drop(df):
272285
df = df.drop("c")
273286

0 commit comments

Comments
 (0)