Skip to content

Commit f9ba912

Browse files
committed
Merge remote-tracking branch 'upstream/main' into ci/tests
2 parents 8944a02 + 5b16c06 commit f9ba912

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

doc/source/user_guide/enhancingperf.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ prefer that Numba throw an error if it cannot compile a function in a way that
427427
speeds up your code, pass Numba the argument
428428
``nopython=True`` (e.g. ``@jit(nopython=True)``). For more on
429429
troubleshooting 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

432432
Using ``parallel=True`` (e.g. ``@jit(parallel=True)``) may result in a ``SIGABRT`` if the threading layer leads to unsafe
433433
behavior. 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>`__

pandas/core/dtypes/common.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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

pandas/tests/dtypes/test_common.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import pandas._testing as tm
2323
from pandas.api.types import pandas_dtype
2424
from 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

789790
def 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

0 commit comments

Comments
 (0)