-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Fix concat series loss of timezone #24027
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
Changes from 3 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
d80afa0
BUG: Fix concat series loss of timezone
jakezimmer f4b751d
Merge branch 'master' of https://github.com/pandas-dev/pandas
evangelinehl 159c4e6
Fixed naming error for is_datetimetz since this function is no longer…
evangelinehl 2450097
Attempted to use _concat_compat to rectify the timezone bug
jakezimmer 9cb20c4
Merge remote-tracking branch 'origin/master'
jakezimmer 7f9dd52
Attempt to fix tz error with concat compat instead of union
jakezimmer 6cb2022
changing behavior to be based on tz
jakezimmer a4da449
Attempting to fix differing dimensions bug
evangelinehl fe83e6d
Another attempt to fix dimensions bug
evangelinehl 2cbb533
Just trying to test different versions here
evangelinehl f527dcc
Trying to fix dimensions bug now that Travis CI is passing but others…
evangelinehl 583ce49
tests failed so changing it back to when travis ci succeeded
evangelinehl 01a2c10
Changing it back because we're trying to figure out if concat_compat …
evangelinehl 683dccf
Reverting back to version when all tests passed
evangelinehl 857c6be
Restored blank lines
evangelinehl 64da4c0
Added test case for the new tz output
evangelinehl 9e699e4
Fixed style issues
evangelinehl 64182c5
Fixed the whitespace issue in linting
jakezimmer b630d58
Merge branch 'master' into PR_TOOL_MERGE_PR_24027
jreback c7dcdb4
fix up
jreback 165689e
updated whatsnew (v0.24.0) to reflect changes
jakezimmer 43b2e2a
Merge branch 'master' into master
jakezimmer 634c736
no changes since @jreback's fix up commit
jakezimmer 0b86ef9
Update v0.24.0.rst
jakezimmer 1867b3a
removed trailing whitespace
jakezimmer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
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.
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.
this is not the way
_concat_conpat already handles this
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.
I didn’t realize we do call _concat_compat from here... I think we’ve already lost the tz by the time we call it.
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.
So do these if checks not even need to be there? Not sure what this means for the change we had here
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.
@jreback after closer examination, I'm not sure if _concat_compat actually already handles this. If the type is also a category, it simply calls _concat_categorical which then summons _concat_asobject. I think that therefore the change to the code should happen inside _concat_categorical or _concat_asobject.
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.
@jreback calling _concat_compat before the list is modified like this causes _concat_compat to just call _concat_categorical again and back and forth until they reach the maximum recursion depth. We have to modify the array somehow before that happens.
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.
I guess I'm not sure why we aren't doing
The function name is
_concat_asobject
, so let's convert to object and concat them. Can you see if that works?Please write the test first though, and ensure that the test fails with master. Then implement the fix and make sure it works.
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.
I believe I tried this previously but the build fails (I think that was the dimensions bug we had before) @TomAugspurger
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.
Seems like we have some inconsistencies in
concat
that's breaking this approach. IIRC there's an outstanding PR fixing some of these up.I was going by the loose rule of "different dtypes means the result type is object". But things like
mess that up. Not sure what's best here...