-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG/PERF: Avoid listifying in dispatch_to_extension_op #23155
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
Changes from 1 commit
044a99e
fe693d6
cf945ee
6507f43
b7906ea
0125669
f1dd665
07a632e
e378c7d
b2f9243
42b91d0
f03e66b
f14cf0b
32757f6
4fc1d1b
03a367e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -280,7 +280,7 @@ def _coerce_to_ndarray(self): | |
data[self._mask] = self._na_value | ||
return data | ||
|
||
__array_priority__ = 1 # higher than ndarray so ops dispatch to us | ||
__array_priority__ = 1000 # higher than ndarray so ops dispatch to us | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we just put this in the base class? (for the ops mixin) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That seems a little too invasive for a base class. I’d rather leave that up to the subclasser. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so what arithmetic subclass would not want this set? is there an example? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To clarify, I'm not sure if there's a way to unset it, if you don't want to set it in a subclass (you don't want to opt into numpy's array stuff at all). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just find this a detail which would likely be forgotten in any subclass, I don't see a harm and much upset in setting it onthe base class (you can always unset if you really really think you need to). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you unset it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't really know if setting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you document this in the Mixin itself though (if you are not going to set it by defaulrt). It is so non-obvious that you need to do this. |
||
|
||
def __array__(self, dtype=None): | ||
""" | ||
|
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 above seems the good logic to me. But, shouldn't then the
_create_comparison_method
be updated to actually do 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 meant to delete the DataFrame comment. I think it's not so relevant since DataFrames are 2D. I'm assuming most arrays will want to match NumPy's broadcasting behavior.
Which
_create_comparison_method
do you mean?The one used in
ExtensionScalarOpsMixin`?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.
(my comment was about the full block, not especially DataFrame)
The one I was looking at in the diff, is the IntegerArray one I think. But I assume for the base class mixin, the same is true.