Skip to content

Commit e5a2067

Browse files
Backport PR #59818 on branch 2.2.x (BUG: Remove np._get_promotion_state usage) (#59821)
BUG: Remove np._get_promotion_state usage (#59818) (cherry picked from commit 081dcde) Co-authored-by: Lysandros Nikolaou <[email protected]>
1 parent 0ed9982 commit e5a2067

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pandas/tests/series/indexing/test_setitem.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
datetime,
44
)
55
from decimal import Decimal
6+
import os
67

78
import numpy as np
89
import pytest
910

11+
from pandas.compat import WASM
1012
from pandas.compat.numpy import np_version_gte1p24
1113
from pandas.errors import IndexingError
1214

@@ -1443,7 +1445,11 @@ def obj(self):
14431445
marks=pytest.mark.xfail(
14441446
(
14451447
not np_version_gte1p24
1446-
or (np_version_gte1p24 and np._get_promotion_state() != "weak")
1448+
or (
1449+
np_version_gte1p24
1450+
and os.environ.get("NPY_PROMOTION_STATE", "weak") != "weak"
1451+
)
1452+
or WASM
14471453
),
14481454
reason="np.float32(1.1) ends up as 1.100000023841858, so "
14491455
"np_can_hold_element raises and we cast to float64",

0 commit comments

Comments
 (0)