Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TrevorWinstral committed Apr 4, 2024
1 parent b8fb7cf commit 351dfd7
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions py-polars/tests/unit/datatypes/test_temporal.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ def test_upsample(time_zone: str | None, tzinfo: ZoneInfo | timezone | None) ->
assert_frame_equal(up, expected)


def test_offset_deprecated(offset: str | None) -> None:
def test_offset_deprecated() -> None:
df = pl.DataFrame(
{
"time": [
Expand All @@ -622,7 +622,7 @@ def test_offset_deprecated(offset: str | None) -> None:
"admin": ["Åland", "Netherlands", "Åland", "Netherlands"],
"test2": [0, 1, 2, 3],
}
)
).sort("time")

# upsample
with pytest.warns(
Expand Down Expand Up @@ -696,7 +696,14 @@ def test_upsample_crossing_dst(
"values": [1, 2, 3],
}
)
result = df.upsample(time_column="time", every="1d", offset=offset)
if offset is not None:
with pytest.warns(
DeprecationWarning,
match="`offset` is deprecated and will be removed in the next breaking release.",
):
result = df.upsample(time_column="time", every="1d", offset=offset)
else:
result = df.upsample(time_column="time", every="1d", offset=offset)
expected = pl.DataFrame(
{
"time": expected_time,
Expand Down

0 comments on commit 351dfd7

Please sign in to comment.