-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
TST: Test empty input for read_csv (#14867) #14920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -392,6 +393,16 @@ def test_empty_field_eof(self): | |||
names=list('abcd'), engine='c') | |||
assert_frame_equal(df, c) | |||
|
|||
def test_empty_csv_input(self): | |||
# GH14867 | |||
df1 = read_csv(StringIO(), chunksize=20, header=None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would just write a temporary blank file here instead of adding an external file (or even better, just use a StringIO that is empty, or whatever you need)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I am using an empty StringIO in the first test, so sounds like the second test using the external file is redundant. Should I just submit the first test only then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if they behave the same then ok with it (you can add it if you want, but again, use a temp file)
Current coverage is 84.64% (diff: 100%)@@ master #14920 diff @@
==========================================
Files 144 144
Lines 51016 51016
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 43184 43185 +1
+ Misses 7832 7831 -1
Partials 0 0
|
Fixed flake8 issues Added blank csv file Removing unneeded test
7bdde48
to
46ad2a2
Compare
Removed the extra test, all good now. |
thanks! |
Fixed flake8 issues Added blank csv file Removing unneeded test
read_csv
with chunksize set returns emptyDataFrame
Instead ofTextFileReader
#14867git diff upstream/master | flake8 --diff
LMK if it would be more suitable in a different test file.