Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
lithomas1 committed May 20, 2024
1 parent 7e0649f commit fd2ba65
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pandas/core/nanops.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
npt,
)
from pandas.compat._optional import import_optional_dependency
from pandas.compat.numpy import np_version_gt2

from pandas.core.dtypes.common import (
is_complex,
Expand Down Expand Up @@ -155,7 +156,7 @@ def _bn_ok_dtype(dtype: DtypeObj, name: str) -> bool:
# Bottleneck chokes on datetime64, PeriodDtype (or and EA)
if (
dtype != object
and dtype != np.dtypes.StringDType(na_object=libmissing.NA)
and (np_version_gt2 and dtype != np.dtypes.StringDType(na_object=libmissing.NA))
and not needs_i8_conversion(dtype)
):
# GH 42878
Expand Down
4 changes: 4 additions & 0 deletions pandas/tests/indexes/test_numpy_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ def test_numpy_ufuncs_other(index, func):
with tm.external_error_raised(TypeError):
func(index)

elif index.dtype == "string[python]" and func is np.isnan:
with tm.external_error_raised(ValueError):
func(index)

elif is_numeric_dtype(index) and not (
is_complex_dtype(index) and func is np.signbit
):
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/series/test_reductions.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,10 @@ def test_mean_dont_convert_j_to_complex():
with pytest.raises(TypeError, match=msg):
df.agg("mean")

msg = "Could not convert string 'J' to numeric|does not support"
msg = "Could not convert string 'J' to numeric|does not support|Cannot pass"
with pytest.raises(TypeError, match=msg):
df["db"].mean()
msg = "Could not convert string 'J' to numeric|ufunc 'divide'"
msg = "Could not convert string 'J' to numeric|ufunc 'divide'|Cannot pass"
with pytest.raises(TypeError, match=msg):
np.mean(df["db"].astype("string").array)

Expand Down

0 comments on commit fd2ba65

Please sign in to comment.