Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(python): Remove duplicate test #6390

Merged
merged 1 commit into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion py-polars/polars/internals/dataframe/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down
27 changes: 4 additions & 23 deletions py-polars/tests/unit/test_explode.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)

Expand Down Expand Up @@ -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"]],
}