Skip to content

Commit

Permalink
test count rows with filter
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyxu committed Dec 31, 2024
1 parent f2bb5eb commit 7157541
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions python/python/tests/test_fragment.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,3 +422,14 @@ def test_fragment_merge(tmp_path):
tmp_path, merge, read_version=dataset.latest_version
)
assert [f.name for f in dataset.schema] == ["a", "b", "c", "d"]


def test_fragment_count_rows(tmp_path: Path):
data = pa.table({"a": range(800), "b": range(800)})
ds = write_dataset(data, tmp_path)

fragments = ds.get_fragments()
assert len(fragments) == 1

assert fragments[0].count_rows() == 800
assert fragments[0].count_rows("a < 200") == 200

0 comments on commit 7157541

Please sign in to comment.