Skip to content

Commit

Permalink
chore(python): bump pytest from 7.4.0 to 8.0.0 in /py-polars (pola-rs…
Browse files Browse the repository at this point in the history
…#14163)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Stijn de Gooijer <stijndegooijer@gmail.com>
  • Loading branch information
dependabot[bot] and stinodego authored Feb 1, 2024
1 parent 428b540 commit 8b0d378
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion py-polars/requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ gevent
# -------

hypothesis==6.97.4
pytest==7.4.0
pytest==8.0.0
pytest-cov==4.1.0
pytest-xdist==3.5.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ def test_parse_invalid_function(func: str) -> None:
("col", "func", "expr_repr"),
TEST_CASES,
)
@pytest.mark.filterwarnings("ignore:invalid value encountered:RuntimeWarning")
def test_parse_apply_functions(col: str, func: str, expr_repr: str) -> None:
with pytest.warns(
PolarsInefficientMapWarning,
Expand All @@ -251,11 +252,12 @@ def test_parse_apply_functions(col: str, func: str, expr_repr: str) -> None:
)
expected_frame = df.select(
x=pl.col(col),
y=pl.col(col).apply(eval(func)),
y=pl.col(col).map_elements(eval(func)),
)
assert_frame_equal(result_frame, expected_frame)


@pytest.mark.filterwarnings("ignore:invalid value encountered:RuntimeWarning")
def test_parse_apply_raw_functions() -> None:
lf = pl.LazyFrame({"a": [1.1, 2.0, 3.4]})

Expand Down Expand Up @@ -334,7 +336,7 @@ def x10(self, x: pl.Expr) -> pl.Expr:
):
pl_series = pl.Series("srs", [0, 1, 2, 3, 4])
assert_series_equal(
pl_series.apply(lambda x: numpy.cos(3) + x - abs(-1)),
pl_series.map_elements(lambda x: numpy.cos(3) + x - abs(-1)),
numpy.cos(3) + pl_series - 1,
)

Expand Down Expand Up @@ -379,7 +381,7 @@ def test_parse_apply_series(
suggested_expression = parser.to_expression(s.name)
assert suggested_expression == expr_repr

expected_series = s.apply(func)
expected_series = s.map_elements(func)
result_series = eval(suggested_expression)
assert_series_equal(expected_series, result_series)

Expand Down
4 changes: 2 additions & 2 deletions py-polars/tests/unit/operations/map/test_map_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,6 @@ def test_map_elements_on_empty_col_10639() -> None:

def test_apply_deprecated() -> None:
with pytest.deprecated_call():
pl.col("a").apply(lambda x: x + 1)
pl.col("a").apply(np.abs)
with pytest.deprecated_call():
pl.Series([1, 2, 3]).apply(lambda x: x + 1)
pl.Series([1, 2, 3]).apply(np.abs)

0 comments on commit 8b0d378

Please sign in to comment.