Skip to content

Commit

Permalink
Rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
desmondcheongzx committed Aug 19, 2024
1 parent fa76024 commit 16fec99
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/io/test_parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,19 +203,19 @@ def compare_before_and_after(before, after, is_arrow):
if is_arrow:
pd_table = before.to_pandas().explode("nested_col")
assert [pd_table.count().get("nested_col")] == [
x["nested_col"] for x in after.explode(col("nested_col")).count().collect()
x["count"] for x in after.explode(col("nested_col")).count().collect()
]
before_limit_50 = before.take(list(range(min(before.num_rows, 50))))
before_limit_2050 = before.take(list(range(min(before.num_rows, 2050))))
assert before_limit_50.to_pydict() == after_limit_50.to_pydict()
assert before_limit_2050.to_pydict() == after_limit_2050.to_pydict()
pd_table = before_limit_50.to_pandas().explode("nested_col")
assert [pd_table.count().get("nested_col")] == [
x["nested_col"] for x in after_limit_50.explode(col("nested_col")).count().collect()
x["count"] for x in after_limit_50.explode(col("nested_col")).count().collect()
]
pd_table = before_limit_2050.to_pandas().explode("nested_col")
assert [pd_table.count().get("nested_col")] == [
x["nested_col"] for x in after_limit_2050.explode(col("nested_col")).count().collect()
x["count"] for x in after_limit_2050.explode(col("nested_col")).count().collect()
]
else:
assert [x for x in before.explode(col("nested_col")).count().collect()] == [
Expand Down

0 comments on commit 16fec99

Please sign in to comment.