From db80cb4f9358314f797d4b381873583d76ff458b Mon Sep 17 00:00:00 2001 From: Stijn de Gooijer Date: Mon, 23 Jan 2023 15:27:35 +0100 Subject: [PATCH] test(python): Remove duplicate test --- .../polars/internals/dataframe/groupby.py | 2 +- py-polars/tests/unit/test_explode.py | 27 +++---------------- 2 files changed, 5 insertions(+), 24 deletions(-) diff --git a/py-polars/polars/internals/dataframe/groupby.py b/py-polars/polars/internals/dataframe/groupby.py index 0e62cd6fac7c..4501b4ab0a54 100644 --- a/py-polars/polars/internals/dataframe/groupby.py +++ b/py-polars/polars/internals/dataframe/groupby.py @@ -86,7 +86,7 @@ def __init__( def __iter__(self) -> GroupBy[DF]: warnings.warn( "Return type of groupby iteration will change in the next breaking release." - " Iteration will returns tuples of (group_key, data) instead of just data.", + " Iteration will return tuples of (group_key, data) instead of just data.", category=FutureWarning, stacklevel=2, ) diff --git a/py-polars/tests/unit/test_explode.py b/py-polars/tests/unit/test_explode.py index 1d1c22f637b0..d4929912e75f 100644 --- a/py-polars/tests/unit/test_explode.py +++ b/py-polars/tests/unit/test_explode.py @@ -1,7 +1,6 @@ from __future__ import annotations import pyarrow as pa -import pytest import polars as pl from polars.testing import assert_frame_equal, assert_series_equal @@ -23,17 +22,15 @@ def test_groupby_flatten_list() -> None: assert_frame_equal(result, expected) -@pytest.mark.skip( - "This does not work due to a bug. Fix it then remove this marker!" - "See: https://github.com/pola-rs/polars/issues/6369" -) def test_groupby_flatten_string() -> None: df = pl.DataFrame({"group": ["a", "b", "b"], "values": ["foo", "bar", "baz"]}) - result = df.groupby("group", maintain_order=True).agg(pl.col("values").flatten()) expected = pl.DataFrame( - {"group": ["a", "b"], "values": [list("foo"), list("barbaz")]} + { + "group": ["a", "b"], + "values": [["f", "o", "o"], ["b", "a", "r", "b", "a", "z"]], + } ) assert_frame_equal(result, expected) @@ -224,19 +221,3 @@ def test_explode_inner_lists_3985() -> None: .agg(pl.col("categories")) .with_column(pl.col("categories").arr.eval(pl.element().arr.explode())) ).collect().to_dict(False) == {"id": [1], "categories": [["a", "b", "a", "c"]]} - - -def test_utf8_sliced_explode() -> None: - df = pl.DataFrame( - { - "group": ["a", "b", "b"], - "values": ["foo", "bar", "baz"], - } - ) - - assert df.groupby("group", maintain_order=True).agg( - pl.col("values").flatten() - ).to_dict(False) == { - "group": ["a", "b"], - "values": [["f", "o", "o"], ["b", "a", "r", "b", "a", "z"]], - }