diff --git a/narwhals/_pandas_like/series.py b/narwhals/_pandas_like/series.py index 25486f54f..74e1c492d 100644 --- a/narwhals/_pandas_like/series.py +++ b/narwhals/_pandas_like/series.py @@ -619,7 +619,9 @@ def quantile( def zip_with(self: Self, mask: Any, other: Any) -> PandasLikeSeries: ser = self._native_series - mask = validate_column_comparand(ser.index, mask, broadcast_length_one=False) + mask = validate_column_comparand( + ser.index, mask, treat_length_one_as_scalar=False + ) other = validate_column_comparand(ser.index, other) res = ser.where(mask, other) return self._from_native_series(res) diff --git a/narwhals/_pandas_like/utils.py b/narwhals/_pandas_like/utils.py index e24e6d4c4..88e61b32a 100644 --- a/narwhals/_pandas_like/utils.py +++ b/narwhals/_pandas_like/utils.py @@ -30,7 +30,7 @@ def validate_column_comparand( - index: Any, other: Any, *, broadcast_length_one: bool = True + index: Any, other: Any, *, treat_length_one_as_scalar: bool = True ) -> Any: """Validate RHS of binary operation. @@ -52,7 +52,7 @@ def validate_column_comparand( if isinstance(other, PandasLikeDataFrame): return NotImplemented if isinstance(other, PandasLikeSeries): - if other.len() == 1 and broadcast_length_one: + if other.len() == 1 and treat_length_one_as_scalar: # broadcast return other.item() if other._native_series.index is not index: