Skip to content

TST: to_json keeps column info with empty dataframe (#7445) #14893

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

Closed
wants to merge 1 commit into from

Conversation

mroeschke
Copy link
Member

Closed by #9805

@jorisvandenbossche jorisvandenbossche added this to the 0.20.0 milestone Dec 16, 2016
@jorisvandenbossche jorisvandenbossche added IO JSON read_json, to_json, json_normalize Testing pandas testing functions or related to the test suite labels Dec 16, 2016
Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect!

@jreback
Copy link
Contributor

jreback commented Dec 16, 2016

the original issue has sufficient tests AFICT. what does this add?

@codecov-io
Copy link

codecov-io commented Dec 16, 2016

Current coverage is 85.31% (diff: 100%)

No coverage report found for master at e7df751.

Powered by Codecov. Last update e7df751...fe2b110

@jorisvandenbossche
Copy link
Member

Ah, yes, that is maybe true. The original PR has roundtrip tests for empty frames, while this one adds an explicit test of the output format in such a case. So that's maybe slightly useful to add, but in any case, if we keep it, would be good to have them at the same place

@mroeschke
Copy link
Member Author

Agreed, makes sense to move it to test_frame_empty. Doesn't look like this specific case is tested there. I'll make the change later tonight.

@jreback
Copy link
Contributor

jreback commented Dec 16, 2016

thanks!

ischurov pushed a commit to ischurov/pandas that referenced this pull request Dec 19, 2016
closes pandas-dev#7445

Author: Matt Roeschke <[email protected]>

Closes pandas-dev#14893 from mroeschke/test_7445 and squashes the following commits:

740cafe [Matt Roeschke] TST: to_json keeps column info with empty dataframe (pandas-dev#7445)
@mroeschke mroeschke deleted the test_7445 branch December 20, 2017 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO JSON read_json, to_json, json_normalize Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Column information lost in to_json() if data frame is empty
4 participants