-
-
Notifications
You must be signed in to change notification settings - Fork 141
allow np.uint64 to be used in indexing. Support numpy 1.24.1 #510
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 all commits
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 |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
import pandas as pd | ||
from pandas import Grouper | ||
from pandas.api.extensions import ExtensionArray | ||
from pandas.util.version import Version | ||
import pytest | ||
from typing_extensions import assert_type | ||
|
||
|
@@ -1705,7 +1706,7 @@ def test_pivot_table() -> None: | |
), | ||
pd.DataFrame, | ||
) | ||
with pytest.warns(np.VisibleDeprecationWarning): | ||
if Version(np.__version__) <= Version("1.23.5"): | ||
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 would be fine removing tests for older versions 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. We can remove this test once the bug is fixed in pandas. There is a PR for that now at pandas-dev/pandas#50682 |
||
check( | ||
assert_type( | ||
pd.pivot_table( | ||
|
@@ -1719,7 +1720,6 @@ def test_pivot_table() -> None: | |
), | ||
pd.DataFrame, | ||
) | ||
with pytest.warns(np.VisibleDeprecationWarning): | ||
check( | ||
assert_type( | ||
pd.pivot_table( | ||
|
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.
Wouldn't any
np.NDArray
work (not just integer) as long as the DataFrame index is of the same type?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.
could probably only enforce a tight dtype match if index was generic
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.
Probably, but since we can't track the
dtype
of anIndex
in aDataFrame
, I'm limiting this for now to the issue that was reported. I think most people use arrays ofint
or arrays ofstr
(which we probably could add), but I'd rather be incremental in adding support for all the possible types.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.
If we knew the dtype of the underlying index, but we don't know that.