-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
REF: EA quantile logic to EA._quantile #44412
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
jbrockmendel
commented
Nov 12, 2021
- closes #xxxx
- tests added / passed
- Ensure all linting tests pass, see here for how to run them
- whatsnew entry
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 am personally not super fond of moving this code. The ExtensionArray
class also serves as a base class and example implementation for external EA authors, and for that purpose I am not sure this is useful (it allows to override it, of course (I don't know if we had feature requests for that up to now?), but for that purpose I would also simplify the base implementation).
(the dual use case as base class for internal usage vs external usage is sometimes a bit conflicting ..)
Is it really annoying to have the code in array_algos/quantile.py ?
pandas/core/arrays/base.py
Outdated
ExtensionArray compatibility layer for quantile_with_mask. | ||
|
||
We pretend that an ExtensionArray with shape (N,) is actually (1, N,) | ||
for compatibility with non-EA code. |
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 docstring would need to be updated to be written for EA implementors (eg for those it doesn't matter this is a compatility layer for quantile_with_mask)
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.
Good point, will update
i sympathize with this
A bit, yes. The idea of array_algos is to not depend on EA implementation details (the docstring in |
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.
am fine with this, though anyway to combine some of the added code that is in base & masked?
there might be, but i haven't found it. trouble is we call the constructors differently in the masked code |