-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
ENH: Update numpy exceptions imports #54405
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
ENH: Update numpy exceptions imports #54405
Conversation
5d26681
to
4362824
Compare
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.
Thanks for the PR.
Left a minor comment.
pandas/core/common.py
Outdated
@@ -236,7 +238,8 @@ def asarray_tuplesafe(values: Iterable, dtype: NpDtype | None = None) -> ArrayLi | |||
try: | |||
with warnings.catch_warnings(): | |||
# Can remove warning filter once NumPy 1.24 is min version | |||
warnings.simplefilter("ignore", np.VisibleDeprecationWarning) | |||
if Version(np.__version__) < Version("1.24.0"): |
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.
you can use
np_version_gte1p24 = _nlv >= Version("1.24") |
instead here and below.
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.
Sure! I updated it to use these helpers.
0ce64e0
to
3894c6e
Compare
Thanks @mtsokol |
* ENH: Update numpy exceptions imports * ENH: Use version checks from dedicated utils
Due to NumPy's main namespace being changed in numpy/numpy#24316, here I update warning imports.
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.