Skip to content
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

concat ignoring DataFrame withouth columns #10359

Merged
merged 1 commit into from Jul 10, 2023
Merged

Conversation

phofl
Copy link
Collaborator

@phofl phofl commented Jun 15, 2023

  • Tests added / passed
  • Passes pre-commit run --all-files

We found this in dask-expr. The check was implemented to ignore completely empty DataFrames, since it would coerce ints to floats, but we should keep DataFrames with no columns but an Index

if axis == 1:
try:
# remove any empty DataFrames
dfs = [df for df in dfs if bool(len(df.columns))]
Copy link
Contributor

Choose a reason for hiding this comment

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

In PR description, you mention that:

we should keep DataFrames with no columns but an Index"

This code doesn't seem to be doing it, and I don't see a test case for it. Can you clarify?

Copy link
Collaborator Author

@phofl phofl Jun 23, 2023

Choose a reason for hiding this comment

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

I forgot one important part:

we should keep DataFrames with no columns but an Index for axis=0

Reason is simple: Consistency with pandas

Copy link
Contributor

@j-bennet j-bennet left a comment

Choose a reason for hiding this comment

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

👍

@hendrikmakait hendrikmakait self-requested a review July 10, 2023 09:03
Copy link
Member

@hendrikmakait hendrikmakait left a comment

Choose a reason for hiding this comment

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

Thanks, @phofl!

@hendrikmakait hendrikmakait merged commit 67e6489 into dask:main Jul 10, 2023
23 of 24 checks passed
@phofl phofl deleted the concat branch July 10, 2023 14:20
j-bennet pushed a commit to j-bennet/dask that referenced this pull request Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants