Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
reswqa committed Aug 26, 2023
1 parent fa24d9f commit 6d14167
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/polars-core/src/chunked_array/ops/repeat_by.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type LargeListArray = ListArray<i64>;
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(())
Expand Down
3 changes: 2 additions & 1 deletion py-polars/tests/unit/dataframe/test_df.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])))

Expand Down

0 comments on commit 6d14167

Please sign in to comment.