-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: transpose not respecting CoW #51430
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 all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
138df12
BUG: transpose not respecting CoW
phofl 29c1bda
FIx
phofl 001ddac
Merge branch 'main' into cow_transpose
phofl f0336da
Merge remote-tracking branch 'upstream/main' into cow_transpose
phofl ffcd4c0
Adjust
phofl d305e42
Merge remote-tracking branch 'upstream/main' into cow_transpose
phofl 530f00c
Fix ci
phofl 742e54c
Fix array manager
phofl bdbc286
Merge branch 'main' into cow_transpose
phofl 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
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
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
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.
I also don't understand how the case in transpose can ever run into this? Because we should only get here in case of
self._can_fast_transpose
, and then by definition there should only be 1 block?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.
the constructor infers this to date time after transposing the array. We get 1 Timedelta block back and another NaT block We could consider this a bug though...
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.
Ah, yes, I seem to recall that we have had discussions about this corner case before (IMO we should indeed change that)
I tried locally with object dtype with ints to test, but so this corner case is only for time like, I suppose.
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.
Yeah we are calling maybe_infer_datetimelike under the hood which causes 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.
Should we deprecate this first?
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.
And note that this is not only about transpose, it's about constructors in general. So the question is also if we want to change this:
(but that's for another issue)
Although of course we could fix this locally in transpose to specifically fix transpose to preserve the dtype.
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 think the constructor would have to be deprecated. Transpose is more of a bug fix imo because that we are using the inference rules of the constructor under the hood is more an implementation detail.
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.
One related issue: #39117
It's also not clear we necessarily want to deprecate this for the constructors. But for transpose() I would certainly consider it a bug / something to change. And for transpose() I am not sure a deprecation is needed
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.
Yeah constructors makes a bit of sense.
I'll try what's failing locally when changing 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.
We have tests covering exactly this behavior :(
#26285
So lets merge this without tackling this case