Skip to content

Commit

Permalink
BUG: Remove np._get_promotion_state usage (#59818)
Browse files Browse the repository at this point in the history
  • Loading branch information
lysnikolaou authored Sep 16, 2024
1 parent 013ac67 commit 081dcde
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions pandas/tests/series/indexing/test_setitem.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@
datetime,
)
from decimal import Decimal
import os

import numpy as np
import pytest

from pandas._config import using_string_dtype

from pandas.compat import HAS_PYARROW
from pandas.compat import (
HAS_PYARROW,
WASM,
)
from pandas.compat.numpy import np_version_gte1p24
from pandas.errors import IndexingError

Expand Down Expand Up @@ -1446,7 +1450,11 @@ def obj(self):
marks=pytest.mark.xfail(
(
not np_version_gte1p24
or (np_version_gte1p24 and np._get_promotion_state() != "weak")
or (
np_version_gte1p24
and os.environ.get("NPY_PROMOTION_STATE", "weak") != "weak"
)
or WASM
),
reason="np.float32(1.1) ends up as 1.100000023841858, so "
"np_can_hold_element raises and we cast to float64",
Expand Down

0 comments on commit 081dcde

Please # to comment.