-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
CLN: Move some PI/DTI methods to EA subclasses, implement tests #22961
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 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
0a5f343
Move some PeriodIndex/DatetimeIndex methods to EA subclasses, impleme…
jbrockmendel f1f5146
fixup missing import
jbrockmendel effef65
Merge branch 'master' of https://github.com/pandas-dev/pandas into dl…
jbrockmendel 4eb5060
Suggested renames
jbrockmendel 09f1b02
Revert change that broke things
jbrockmendel 68116c4
Revert change that broke tests
jbrockmendel 12eb1b9
Fix failing test by ammending constructor
jbrockmendel ed30d73
flake8 whitespace fixup
jbrockmendel 5b4c828
requested verbosification
jbrockmendel 61808d3
fixup property wrapping
jbrockmendel 927e4bd
Merge branch 'master' of https://github.com/pandas-dev/pandas into dl…
jbrockmendel 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
fixup property wrapping
- Loading branch information
commit 61808d3a2b0f650feca5c6546bd8b41208d4c7bd
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.
I would leave those properties here, since we will need to add them back when doing the actual refactor
(or you can call the ArrayMixin version like you did for
to_period
/to_timestamp
, but in this case that will be more verbose than what is there now (but which is not necessarily a problem, we can simplify when doing the actual refactor))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, so on this PR, these are inherited from
DatetimelikeArrayMixin
, which won't be a parent of PeriodIndex in the future?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 in the future, assuming we do away with inheritance (which I'm still -0 on), we'll use something akin to
to succinctly implement appropriate wrapping.
In the interim, removing code from the Index subclasses makes it easier for me to sort out what methods still need to be migrated.
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.
Close, they are inherited from PeriodArrayMixin
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.
Yes, that might certainly be (or maybe with a method adding them like we do for eg arithmetic methods), but I don't think we will do that in an initial PR that does the refactor, so moving it away now, will make that PR bigger / less easy to understand
Then I would suggest calling the ArrayMixin implementation as you did for to_timestamp/to_array. That also makes it clear what is already moved and what not yet
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.
Sure, will do.
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.
Actually given the CI turnaround, if there’s consensus here I’d like to make this change in a follow-up.
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 would do it here (travis is still fast)
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.
done