Skip to content
13 changes: 11 additions & 2 deletions tests/series_only/hist_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
from tests.utils import ConstructorEager
from tests.utils import assert_equal_data

pytest.skip(
reason="https://github.com/narwhals-dev/narwhals/issues/2348", allow_module_level=True
xfail_hist = pytest.mark.xfail(
reason="https://github.com/narwhals-dev/narwhals/issues/2348", strict=False
Comment on lines +16 to +17
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I used this on every test to mimic what skip was doing
  • No idea which one(s) was causing the failures

)


data = {
"int": [0, 1, 2, 3, 4, 5, 6],
}
Expand Down Expand Up @@ -80,6 +81,7 @@
]


@xfail_hist
@pytest.mark.parametrize("params", bins_and_expected)
@pytest.mark.parametrize("include_breakpoint", [True, False])
@pytest.mark.filterwarnings(
Expand Down Expand Up @@ -165,6 +167,7 @@ def test_hist_bin(
assert_equal_data(result, expected)


@xfail_hist
@pytest.mark.parametrize("params", counts_and_expected)
@pytest.mark.parametrize("include_breakpoint", [True, False])
@pytest.mark.filterwarnings(
Expand Down Expand Up @@ -236,6 +239,7 @@ def test_hist_count(
)


@xfail_hist
@pytest.mark.filterwarnings(
"ignore:`Series.hist` is being called from the stable API although considered an unstable feature."
)
Expand Down Expand Up @@ -272,6 +276,7 @@ def test_hist_count_no_spread(
assert_equal_data(result, expected)


@xfail_hist
@pytest.mark.filterwarnings(
"ignore:`Series.hist` is being called from the stable API although considered an unstable feature."
)
Expand All @@ -287,6 +292,7 @@ def test_hist_bin_and_bin_count() -> None:
s.hist(bins=[1, 3], bin_count=4)


@xfail_hist
@pytest.mark.filterwarnings(
"ignore:`Series.hist` is being called from the stable API although considered an unstable feature."
)
Expand Down Expand Up @@ -335,6 +341,7 @@ def test_hist_small_bins(
s["values"].hist(bins=[1, 3], bin_count=4)


@xfail_hist
@pytest.mark.filterwarnings(
"ignore:`Series.hist` is being called from the stable API although considered an unstable feature."
)
Expand Down Expand Up @@ -369,6 +376,7 @@ def test_hist_non_monotonic(constructor_eager: ConstructorEager) -> None:
st.floats(min_value=0.001, max_value=1_000, allow_nan=False), max_size=50
),
)
@xfail_hist
@pytest.mark.filterwarnings(
"ignore:`Series.hist` is being called from the stable API although considered an unstable feature.",
"ignore:invalid value encountered in cast:RuntimeWarning",
Expand Down Expand Up @@ -425,6 +433,7 @@ def test_hist_bin_hypotheis(
),
bin_count=st.integers(min_value=0, max_value=1_000),
)
@xfail_hist
@pytest.mark.skipif(
POLARS_VERSION < (1, 15),
reason="hist(bin_count=...) behavior significantly changed after this version",
Expand Down
Loading