Skip to content

Commit d73ef10

Browse files
bryanyang0528igorborgest
authored andcommitted
add test for pandas_kwargs when chunksize is not none
1 parent aecf0e0 commit d73ef10

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

testing/test_awswrangler/test_moto.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,15 @@ def test_csv(s3):
221221
assert len(df.columns) == 10
222222

223223

224+
def test_read_csv_with_chucksize_and_pandas_arguments(s3):
225+
path = "s3://bucket/test.csv"
226+
wr.s3.to_csv(df=get_df_csv(), path=path, index=False)
227+
dfs = [dfs for dfs in wr.s3.read_csv(path=path, chunksize=1, usecols=['id', 'string'])]
228+
assert len(dfs) == 3
229+
for df in dfs:
230+
assert len(df.columns) == 2
231+
232+
224233
@mock.patch("pandas.read_csv")
225234
@mock.patch("s3fs.S3FileSystem.open")
226235
def test_read_csv_pass_pandas_arguments_and_encoding_succeed(mock_open, mock_read_csv, s3):

0 commit comments

Comments
 (0)