Skip to content

BUG: combine_first ignoring others columns if other is empty #53792

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 2 commits into from
Jun 22, 2023

Conversation

phofl
Copy link
Member

@phofl phofl commented Jun 22, 2023

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

@phofl phofl added Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Jun 22, 2023

def test_combine_first_empty_columns():
left = DataFrame(columns=["a", "b"])
right = DataFrame(columns=["a", "c"])
Copy link
Member

Choose a reason for hiding this comment

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

Could you also test where right has a different dtype than left?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is actually covered. The reindex casts to float while right has object dtype

Copy link
Member

Choose a reason for hiding this comment

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

Oh right. Sounds good

@mroeschke mroeschke added this to the 2.1 milestone Jun 22, 2023
@mroeschke mroeschke merged commit 644c10d into pandas-dev:main Jun 22, 2023
@mroeschke
Copy link
Member

Thanks @phofl

@phofl phofl deleted the combine_first branch June 22, 2023 16:06
Daquisu pushed a commit to Daquisu/pandas that referenced this pull request Jul 8, 2023
…dev#53792)

* BUG: combine_first ignoring others columns if other is empty

* Fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants