File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed
Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -427,7 +427,7 @@ prefer that Numba throw an error if it cannot compile a function in a way that
427427speeds up your code, pass Numba the argument
428428``nopython=True `` (e.g. ``@jit(nopython=True) ``). For more on
429429troubleshooting Numba modes, see the `Numba troubleshooting page
430- <https://numba.pydata.org/numba-doc/latest /user/troubleshoot.html#the-compiled-code-is-too-slow > `__.
430+ <https://numba.readthedocs.io/en/stable /user/troubleshoot.html> `__.
431431
432432Using ``parallel=True `` (e.g. ``@jit(parallel=True) ``) may result in a ``SIGABRT `` if the threading layer leads to unsafe
433433behavior. You can first `specify a safe threading layer <https://numba.readthedocs.io/en/stable/user/threading-layer.html#selecting-a-threading-layer-for-safe-parallel-execution >`__
Original file line number Diff line number Diff line change @@ -1836,6 +1836,8 @@ def pandas_dtype(dtype) -> DtypeObj:
18361836 # raise a consistent TypeError if failed
18371837 try :
18381838 with warnings .catch_warnings ():
1839+ # TODO: warnings.catch_warnings can be removed when numpy>2.2.2
1840+ # is the minimum version
18391841 # GH#51523 - Series.astype(np.integer) doesn't show
18401842 # numpy deprecation warning of np.integer
18411843 # Hence enabling DeprecationWarning
Original file line number Diff line number Diff line change 2222import pandas ._testing as tm
2323from pandas .api .types import pandas_dtype
2424from pandas .arrays import SparseArray
25+ from pandas .util .version import Version
2526
2627
2728# EA & Actual Dtypes
@@ -788,11 +789,18 @@ def test_validate_allhashable():
788789
789790def test_pandas_dtype_numpy_warning ():
790791 # GH#51523
791- with tm .assert_produces_warning (
792- DeprecationWarning ,
793- check_stacklevel = False ,
794- match = "Converting `np.integer` or `np.signedinteger` to a dtype is deprecated" ,
795- ):
792+ if Version (np .__version__ ) <= Version ("2.2.2" ):
793+ ctx = tm .assert_produces_warning (
794+ DeprecationWarning ,
795+ check_stacklevel = False ,
796+ match = (
797+ "Converting `np.integer` or `np.signedinteger` to a dtype is deprecated"
798+ ),
799+ )
800+ else :
801+ ctx = tm .external_error_raised (TypeError )
802+
803+ with ctx :
796804 pandas_dtype (np .integer )
797805
798806
You can’t perform that action at this time.
0 commit comments