Skip to content

Commit 8a63395

Browse files
Merge branch 'nested_list_comparison' into combine_tests
2 parents 933e1aa + 3d5467a commit 8a63395

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

tests/test_conditions.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,34 @@ def test_condition_equal_columns_lists_only_inner() -> None:
512512
assert actual.to_list() == [True, False]
513513

514514

515+
def test_condition_equal_columns_two_lists_no_max_length() -> None:
516+
lhs = pl.DataFrame(
517+
{
518+
"pk": [1, 2],
519+
"a_left": [[1.0, 2.0], [3.0, 4.0]],
520+
},
521+
)
522+
rhs = pl.DataFrame(
523+
{
524+
"pk": [1, 2],
525+
"a_right": [[1.0, 2.0], [3.0, 4.0]],
526+
},
527+
)
528+
529+
with pytest.raises(
530+
ValueError,
531+
match="max_list_length must be provided for List-vs-List comparisons",
532+
):
533+
lhs.join(rhs, on="pk", maintain_order="left").select(
534+
condition_equal_columns(
535+
"a",
536+
dtype_left=lhs.schema["a_left"],
537+
dtype_right=rhs.schema["a_right"],
538+
max_list_length=None,
539+
)
540+
).to_series()
541+
542+
515543
@pytest.mark.parametrize(
516544
("dtype_left", "dtype_right", "can_compare_dtypes"),
517545
[

0 commit comments

Comments
 (0)