Skip to content

Commit

Permalink
feat: adapt tests for csv_meta changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanix-Darker committed Nov 14, 2023
1 parent 384b555 commit 755f378
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/readers/test_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def test_csv_metadata(path):
"total_rows": 12,
}

# skiprows as integer
ds = DataSource(
path("fixture-1.csv"),
reader_kwargs={"skiprows": 3, "skipfooter": 4},
Expand All @@ -85,6 +86,17 @@ def test_csv_metadata(path):
"total_rows": 12,
}

# skiprows as list
ds = DataSource(
path("fixture-1.csv"),
reader_kwargs={"skiprows": [0, 2, 4], "skipfooter": 4},
)
assert ds.get_df().shape == (5, 2)
assert ds.get_metadata() == {
"df_rows": 5,
"total_rows": 12,
}

ds = DataSource(
path("fixture-1.csv"),
reader_kwargs={"nrows": 3},
Expand Down

0 comments on commit 755f378

Please sign in to comment.