Skip to content

Commit

Permalink
Update test_sort.py
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewgazelka authored Nov 21, 2024
1 parent 2a97b13 commit 156c2a3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/connect/test_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ def test_sort(spark_session):
df_sorted = df.sort(col("id").desc())

# Verify the DataFrame is sorted correctly
df_pandas = df.toPandas()
df_sorted_pandas = df_sorted.toPandas()
assert df_sorted_pandas["id"].equals(df_pandas["id"].sort_values(ascending=False).reset_index(drop=True)), "Data should be sorted in descending order"
actual = df.to_arrow().to_pydict() # or df.toPandas().to_dict()
expected = daft.from_pydict({"id": list(range(10))}).sort("id", descending=True).to_pydict()
assert actual == expected

0 comments on commit 156c2a3

Please sign in to comment.