Skip to content

Commit

Permalink
oops
Browse files Browse the repository at this point in the history
  • Loading branch information
nameexhaustion committed Jun 18, 2024
1 parent 2f061c0 commit 5e1ca5c
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions py-polars/tests/unit/io/test_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,38 @@ def test_scan_with_row_index_limit_and_filter(
)


@pytest.mark.write_disk()
def test_scan_with_row_index_filter_and_limit(
capfd: Any, monkeypatch: pytest.MonkeyPatch, data_file: _DataFile, force_async: bool
) -> None:
if data_file.path.suffix == ".csv" and force_async:
pytest.skip(reason="async reading of .csv not yet implemented")

if force_async:
_enable_force_async(monkeypatch)

df = (
_scan(data_file.path, data_file.df.schema, row_index=_RowIndex())
.filter(pl.col("sequence") % 2 == 0)
.limit(4483)
.collect()
)

if force_async:
_assert_force_async(capfd)

assert_frame_equal(
df,
pl.DataFrame(
{
"index": (2 * x for x in range(4483)),
"sequence": (2 * x for x in range(4483)),
},
schema_overrides={"index": pl.UInt32},
),
)


@pytest.mark.write_disk()
@pytest.mark.parametrize(
("scan_func", "write_func"),
Expand Down

0 comments on commit 5e1ca5c

Please sign in to comment.