Skip to content

Commit

Permalink
chore: avoid unnecessary branching on pl version in pln.mean
Browse files Browse the repository at this point in the history
  • Loading branch information
AlessandroMiola committed Dec 9, 2024
1 parent adadecc commit 79a23a1
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions narwhals/_polars/namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,8 @@ def mean(self: Self, *column_names: str) -> PolarsExpr:

from narwhals._polars.expr import PolarsExpr

if self._backend_version < (0, 20, 4):
return PolarsExpr(
pl.mean([*column_names]), # type: ignore[arg-type]
version=self._version,
backend_version=self._backend_version,
)
return PolarsExpr(
pl.mean(*column_names),
pl.mean([*column_names]), # type: ignore[arg-type]
version=self._version,
backend_version=self._backend_version,
)
Expand Down

0 comments on commit 79a23a1

Please sign in to comment.