-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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
Added test case to lock in behaviour #48541
Merged
mroeschke
merged 5 commits into
pandas-dev:main
from
ssche:gh-48510-concat-to-empty-ea-removes-type-info
Sep 15, 2022
Merged
Added test case to lock in behaviour #48541
mroeschke
merged 5 commits into
pandas-dev:main
from
ssche:gh-48510-concat-to-empty-ea-removes-type-info
Sep 15, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* In previous versions, concatenating to empty EA was resetting type information to np.object
mroeschke
reviewed
Sep 14, 2022
mroeschke
reviewed
Sep 14, 2022
mroeschke
reviewed
Sep 14, 2022
* whatsnew: made "Loss of dtype" more specific and improved wording (EA -> ExtensionArray, etc) * testcase: moved test case to test_empty.py and use `tm.assert_frame_equal()` with an expected dataframe
mroeschke
reviewed
Sep 15, 2022
doc/source/whatsnew/v1.6.0.rst
Outdated
@@ -212,6 +212,7 @@ Sparse | |||
ExtensionArray | |||
^^^^^^^^^^^^^^ | |||
- Bug in :meth:`Series.mean` overflowing unnecessarily with nullable integers (:issue:`48378`) | |||
- When concatenating DataFrame containing an empty ExtensionArray Series with another DataFrame with an ExtensionArray of the same type, the resulting dtype turned into object (:issue:`48510`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
- When concatenating DataFrame containing an empty ExtensionArray Series with another DataFrame with an ExtensionArray of the same type, the resulting dtype turned into object (:issue:`48510`) | |
- Bug when concatenating an empty DataFrame with an ExtensionDtype to another DataFrame with the same ExtensionDtype, the resulting dtype turned into object (:issue:`48510`) |
Looks to be some style issues: https://github.com/pandas-dev/pandas/actions/runs/3056453602/jobs/4930635737 |
* Use concat/DataFrame as they were directly imported (instead of `pd...`)
mroeschke
approved these changes
Sep 15, 2022
Thanks @ssche |
noatamir
pushed a commit
to noatamir/pandas
that referenced
this pull request
Nov 9, 2022
* Added test case to lock in behaviour * In previous versions, concatenating to empty EA was resetting type information to np.object * Update whatsnew * Addressed code review comments * whatsnew: made "Loss of dtype" more specific and improved wording (EA -> ExtensionArray, etc) * testcase: moved test case to test_empty.py and use `tm.assert_frame_equal()` with an expected dataframe * Fixed style issue * Use concat/DataFrame as they were directly imported (instead of `pd...`) * Improved whatsnew entry as per suggestion Co-authored-by: Sven <you@example.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
NA - MaskedArrays
Related to pd.NA and nullable extension arrays
Reshaping
Concat, Merge/Join, Stack/Unstack, Explode
Testing
pandas testing functions or related to the test suite
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.I wasn't sure which issue to reference since it was resolved as part of something else, so I took this one for which I only really added a test case (not the actual fix). @mroeschke would you like me to reference another issue instead (or remove this from whatsnew entirely)?