Skip to content

Unit Test: Construction of DataFrame works with empty list but not empty array #47192

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 12 commits into from
Jun 11, 2022

Conversation

weikhor
Copy link
Contributor

@weikhor weikhor commented Jun 1, 2022

@weikhor weikhor changed the title BUG fix: Construction of DataFrame works with empty list but not empty arra BUG fix: Construction of DataFrame works with empty list but not empty array Jun 1, 2022
Copy link
Member

@phofl phofl left a comment

Choose a reason for hiding this comment

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

Do we really want that?

@jreback jreback added the Constructors Series/DataFrame/Index/pd.array Constructors label Jun 5, 2022
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

this is as intended, so i don't think we want to change.

Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

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

@weikhor instead could you just write a unit test pandas.DataFrame(data=numpy.array([]), columns=['a','b']) raises an exception cementing this behavior?

@weikhor weikhor changed the title BUG fix: Construction of DataFrame works with empty list but not empty array Unit Test: Construction of DataFrame works with empty list but not empty array Jun 6, 2022
@weikhor weikhor requested a review from mroeschke June 6, 2022 08:24
@mroeschke mroeschke added this to the 1.5 milestone Jun 6, 2022
@weikhor weikhor requested a review from mroeschke June 11, 2022 13:22
Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

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

Thanks LGTM. Needs @jreback approval to merge

@jreback jreback added the Error Reporting Incorrect or improved errors from pandas label Jun 11, 2022
@jreback jreback merged commit a45c7fa into pandas-dev:main Jun 11, 2022
@jreback
Copy link
Contributor

jreback commented Jun 11, 2022

thanks @weikhor

yehoshuadimarsky pushed a commit to yehoshuadimarsky/pandas that referenced this pull request Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Constructors Series/DataFrame/Index/pd.array Constructors Error Reporting Incorrect or improved errors from pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Construction of DataFrame works with empty list but not empty array
4 participants