diff --git a/crates/polars-core/src/chunked_array/ops/repeat_by.rs b/crates/polars-core/src/chunked_array/ops/repeat_by.rs index 54be65f3e430b..69e83a042879a 100644 --- a/crates/polars-core/src/chunked_array/ops/repeat_by.rs +++ b/crates/polars-core/src/chunked_array/ops/repeat_by.rs @@ -9,7 +9,7 @@ type LargeListArray = ListArray; fn check_lengths(length_srs: usize, length_by: usize) -> PolarsResult<()> { polars_ensure!( (length_srs == length_by) | (length_by == 1) | (length_srs == 1), - ComputeError: "repeaty_by argument and the Series should have equal length, or at least one of them should have length 1. Series length {}, by length {}", + ComputeError: "repeat_by argument and the Series should have equal length, or at least one of them should have length 1. Series length {}, by length {}", length_srs, length_by ); Ok(()) diff --git a/py-polars/tests/unit/dataframe/test_df.py b/py-polars/tests/unit/dataframe/test_df.py index e1a00db9ca4ef..1b4e86124e1cc 100644 --- a/py-polars/tests/unit/dataframe/test_df.py +++ b/py-polars/tests/unit/dataframe/test_df.py @@ -1692,7 +1692,8 @@ def test_repeat_by_unequal_lengths_panic() -> None: ) with pytest.raises( pl.ComputeError, - match="""Length of repeat_by argument needs to be 1 or equal to the length of the Series.""", + match="repeat_by argument and the Series should have equal length, " + "or at least one of them should have length 1", ): df.select(pl.col("a").repeat_by(pl.Series([2, 2])))