-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Added extra info section to EA repr #24279
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
Conversation
Hello @TomAugspurger! Thanks for updating the PR. Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated on January 07, 2019 at 15:39 Hours UTC |
Codecov Report
@@ Coverage Diff @@
## master #24279 +/- ##
==========================================
+ Coverage 92.22% 92.22% +<.01%
==========================================
Files 162 162
Lines 51828 51830 +2
==========================================
+ Hits 47798 47801 +3
+ Misses 4030 4029 -1
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #24279 +/- ##
==========================================
+ Coverage 92.22% 93.84% +1.62%
==========================================
Files 162 166 +4
Lines 51828 70087 +18259
==========================================
+ Hits 47798 65774 +17976
- Misses 4030 4313 +283
Continue to review full report at Codecov.
|
can you do the same for Index |
The same what? This is just changing the base ExtensionArray repr. |
yes, the same, to avoid departing from what we do in Index, which is pretty similar. |
Sorry, I'm still not following what you're suggesting. |
https://github.com/pandas-dev/pandas/blob/master/pandas/core/indexes/base.py#L929 this is called _format_attrs in Index, so change one or the other |
IIUC,
|
This is just yet another difference with index. I would rather not have these differences. |
I could imagine a subclass wanting to include something that's not a key-value pair. |
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.
@TomAugspurger and that's fine, so change Index. this duplicated code between EA and Index is driving me bananas. The entire point is to share code. So it needs to be changed in one or the other.
This isn't a priority for me right now. I'd say merge if we think it's an improvement, or close and do it later. Either works for me. |
I guess this is fine. ideally just have some integration with Index here (basically use the |
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.
Personally, I would prefer adding the extra section between length and dtype (so dtype is always the last element), but that's minor.
Is it needed to add an extra method for it? Won't we be able to reuse some existing thing like _attributes
, and then automatically fill in the value for that?
Should we use this new ability to add freq
for DatetimeArray?
Yes, DatetimeArray should use freq for it. I don't know which |
Ah, yes, I meant that |
looking again. this is reasonable. can you merge master. are there other places that you see this being used in the current EA's? (other than Decimal). |
closing this; I think we need more consolidation on repr to avoid code duplication. |
Closes #24278