Skip to content

Commit 081dcde

Browse files
authored
BUG: Remove np._get_promotion_state usage (pandas-dev#59818)
1 parent 013ac67 commit 081dcde

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

pandas/tests/series/indexing/test_setitem.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@
44
datetime,
55
)
66
from decimal import Decimal
7+
import os
78

89
import numpy as np
910
import pytest
1011

1112
from pandas._config import using_string_dtype
1213

13-
from pandas.compat import HAS_PYARROW
14+
from pandas.compat import (
15+
HAS_PYARROW,
16+
WASM,
17+
)
1418
from pandas.compat.numpy import np_version_gte1p24
1519
from pandas.errors import IndexingError
1620

@@ -1446,7 +1450,11 @@ def obj(self):
14461450
marks=pytest.mark.xfail(
14471451
(
14481452
not np_version_gte1p24
1449-
or (np_version_gte1p24 and np._get_promotion_state() != "weak")
1453+
or (
1454+
np_version_gte1p24
1455+
and os.environ.get("NPY_PROMOTION_STATE", "weak") != "weak"
1456+
)
1457+
or WASM
14501458
),
14511459
reason="np.float32(1.1) ends up as 1.100000023841858, so "
14521460
"np_can_hold_element raises and we cast to float64",

0 commit comments

Comments
 (0)