From bdc29ec35eb6c5496a63542dde5ea5c2eb1b4215 Mon Sep 17 00:00:00 2001 From: Orson Peters Date: Thu, 26 Sep 2024 13:40:14 +0200 Subject: [PATCH] fix test --- py-polars/tests/unit/series/test_series.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/py-polars/tests/unit/series/test_series.py b/py-polars/tests/unit/series/test_series.py index 2a4d6f1d5285..0f45cdfb6e21 100644 --- a/py-polars/tests/unit/series/test_series.py +++ b/py-polars/tests/unit/series/test_series.py @@ -980,6 +980,7 @@ def test_reinterpret() -> None: def test_mode() -> None: s = pl.Series("a", [1, 1, 2]) assert s.mode().to_list() == [1] + assert s.set_sorted().mode().to_list() == [1] df = pl.DataFrame([s]) assert df.select([pl.col("a").mode()])["a"].to_list() == [1] @@ -990,7 +991,7 @@ def test_mode() -> None: assert pl.Series([1.0, 2.0, 3.0, 2.0]).mode().item() == 2.0 # sorted data - assert pl.int_range(0, 3, eager=True).mode().to_list() == [2, 1, 0] + assert set(pl.int_range(0, 3, eager=True).mode().to_list()) == {0, 1, 2} def test_diff() -> None: