Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego committed Jun 6, 2024
1 parent 5f852b4 commit 4953f26
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 25 deletions.
4 changes: 3 additions & 1 deletion py-polars/tests/unit/datatypes/test_temporal.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,9 @@ def test_to_list() -> None:

def test_rows() -> None:
s0 = pl.Series("date", [123543, 283478, 1243]).cast(pl.Date)
with pytest.deprecated_call(match="`with_time_unit` is deprecated"):
with pytest.deprecated_call(
match="`ExprDateTimeNameSpace.with_time_unit` is deprecated"
):
s1 = (
pl.Series("datetime", [a * 1_000_000 for a in [123543, 283478, 1243]])
.cast(pl.Datetime)
Expand Down
12 changes: 0 additions & 12 deletions py-polars/tests/unit/operations/test_drop.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,3 @@ def test_drop_without_parameters() -> None:
df = pl.DataFrame({"a": [1, 2]})
assert_frame_equal(df.drop(), df)
assert_frame_equal(df.lazy().drop(*[]), df.lazy())


def test_drop_keyword_deprecated() -> None:
df = pl.DataFrame({"a": [1, 2], "b": [3, 4]})
expected = df.select("b")
with pytest.deprecated_call():
result_df = df.drop(columns="a")
assert_frame_equal(result_df, expected)

with pytest.deprecated_call():
result_lf = df.lazy().drop(columns="a")
assert_frame_equal(result_lf, expected.lazy())
12 changes: 0 additions & 12 deletions py-polars/tests/unit/operations/test_group_by.py
Original file line number Diff line number Diff line change
Expand Up @@ -873,18 +873,6 @@ def test_group_by_named() -> None:
assert_frame_equal(result, expected)


def test_group_by_deprecated_by_arg() -> None:
df = pl.DataFrame({"a": [1, 1, 2, 2, 3, 3], "b": range(6)})
with pytest.deprecated_call():
result = df.group_by(by=(pl.col("a") * 2), maintain_order=True).agg(
pl.col("b").min()
)
expected = df.group_by((pl.col("a") * 2), maintain_order=True).agg(
pl.col("b").min()
)
assert_frame_equal(result, expected)


def test_group_by_with_null() -> None:
df = pl.DataFrame(
{"a": [None, None, None, None], "b": [1, 1, 2, 2], "c": ["x", "y", "z", "u"]}
Expand Down

0 comments on commit 4953f26

Please sign in to comment.