Skip to content

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

Merged
merged 1 commit into from
Dec 20, 2016

Conversation

jeffcarey
Copy link
Contributor

LMK if it would be more suitable in a different test file.

@@ -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,
Copy link
Contributor

@jreback jreback Dec 19, 2016

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)

Copy link
Contributor Author

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?

Copy link
Contributor

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)

@jreback jreback added IO CSV read_csv, to_csv Testing pandas testing functions or related to the test suite labels Dec 19, 2016
@codecov-io
Copy link

codecov-io commented Dec 19, 2016

Current coverage is 84.64% (diff: 100%)

Merging #14920 into master will increase coverage by <.01%

@@             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          

Powered by Codecov. Last update 3ccb501...46ad2a2

Fixed flake8 issues

Added blank csv file

Removing unneeded test
@jeffcarey
Copy link
Contributor Author

Removed the extra test, all good now.

@jreback jreback added this to the 0.20.0 milestone Dec 20, 2016
@jreback jreback merged commit 02906ce into pandas-dev:master Dec 20, 2016
@jreback
Copy link
Contributor

jreback commented Dec 20, 2016

thanks!

ShaharBental pushed a commit to ShaharBental/pandas that referenced this pull request Dec 26, 2016
Fixed flake8 issues

Added blank csv file

Removing unneeded test
@jeffcarey jeffcarey deleted the test/14867 branch January 26, 2017 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO CSV read_csv, to_csv Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TST: read_csv with chunksize set returns empty DataFrame Instead of TextFileReader
3 participants