-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Implement __array__ on ExtensionIndex #32255
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
|
||
|
||
@pytest.mark.parametrize("array", [True, False]) | ||
def test_dunder_array(array): |
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.
do we have this test for indexes generally?
looks ok. @TomAugspurger if you'd have a look. |
do we have an issue for adding |
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.
Don't see an issue for Index.__array_ufunc__
. Opened #32411 as a placeholder.
doc/source/whatsnew/v1.1.0.rst
Outdated
@@ -90,6 +90,8 @@ Backwards incompatible API changes | |||
now raise a ``TypeError`` if a not-accepted keyword argument is passed into it. | |||
Previously a ``UnsupportedFunctionCall`` was raised (``AssertionError`` if ``min_count`` passed into :meth:`~DataFrameGroupby.median``) (:issue:`31485`) | |||
- :meth:`DataFrame.at` and :meth:`Series.at` will raise a ``TypeError`` instead of a ``ValueError`` if an incompatible key is passed, and ``KeyError`` if a missing key is passed, matching the behavior of ``.loc[]`` (:issue:`31722`) | |||
- Passing an integer dtype other than ``int64`` to ``np.array(period_index, dtype=...)`` will now raise ``NotImplementedError`` instead of incorrectly using ``int64`` (:issue:`32255`) |
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.
Why NotImplementedError, rathan something like ValueError? Are we the ones raising it, or is NumPy?
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.
Though from the tests, it looks like a TypeError is raised (unless I'm misreading).
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.
lgtm. merge on @TomAugspurger comments
elif dtype == bool: | ||
return ~self._isnan | ||
|
||
# This will raise TypeErorr for non-object dtypes |
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.
typo for follow-up
Thanks @jbrockmendel |
No description provided.