Skip to content

Commit

Permalink
Add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
leoforney committed Apr 9, 2024
1 parent 9897c49 commit 99029d7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions py-polars/tests/unit/io/test_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,11 @@ def test_compressed_csv(io_files_path: Path) -> None:
out = pl.read_csv(str(csv_file), truncate_ragged_lines=True)
assert_frame_equal(out, expected)

# now with schema defined
schema = {"a": pl.Int64, "b": pl.Utf8, "c": pl.Float64}
out = pl.read_csv(str(csv_file), schema=schema, truncate_ragged_lines=True)
assert_frame_equal(out, expected)

# now with column projection
out = pl.read_csv(csv_bytes, columns=["a", "b"])
expected = pl.DataFrame({"a": [1, 2, 3], "b": ["a", "b", "c"]})
Expand Down

0 comments on commit 99029d7

Please sign in to comment.