From 755f37855a353410dbbae631726bc7b06514ccf2 Mon Sep 17 00:00:00 2001 From: sanix-darker Date: Tue, 14 Nov 2023 12:44:17 +0100 Subject: [PATCH] feat: adapt tests for csv_meta changes --- tests/readers/test_csv.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/readers/test_csv.py b/tests/readers/test_csv.py index 64308cb0..3e15b5c2 100644 --- a/tests/readers/test_csv.py +++ b/tests/readers/test_csv.py @@ -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}, @@ -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},