Skip to content

Commit 933e1aa

Browse files
merge base
2 parents 0a90221 + 8afddd2 commit 933e1aa

2 files changed

Lines changed: 21 additions & 5 deletions

File tree

diffly/_conditions.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,11 @@ def _compare_sequence_columns(
206206
n_elements = dtype_right.shape[0]
207207
has_same_length = col_left.list.len().eq(pl.lit(n_elements))
208208
else: # pl.List vs pl.List
209-
assert max_list_length is not None
209+
if max_list_length is None:
210+
raise ValueError(
211+
"max_list_length must be provided for List-vs-List comparisons "
212+
"in _compare_sequence_columns()."
213+
)
210214
n_elements = max_list_length
211215
has_same_length = col_left.list.len().eq_missing(col_right.list.len())
212216

tests/test_conditions.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -461,17 +461,29 @@ def test_condition_equal_columns_lists_only_inner() -> None:
461461
{
462462
"pk": [1, 2],
463463
"a": [
464-
{"x": 1, "y": [1.0, 2.0, 3.0]},
465-
{"x": 2, "y": [4.0, 5.0, 6.0]},
464+
{
465+
"x": 1,
466+
"y": [1.0, 2.0, 3.0],
467+
},
468+
{
469+
"x": 2,
470+
"y": [4.0, 5.0, 6.0],
471+
},
466472
],
467473
},
468474
)
469475
rhs = pl.DataFrame(
470476
{
471477
"pk": [1, 2],
472478
"a": [
473-
{"x": 1, "y": [1.0, 2.1, 3.0]},
474-
{"x": 2, "y": [4.0, 5.3, 6.0]},
479+
{
480+
"x": 1,
481+
"y": [1.0, 2.1, 3.0],
482+
},
483+
{
484+
"x": 2,
485+
"y": [4.0, 5.3, 6.0],
486+
},
475487
],
476488
},
477489
)

0 commit comments

Comments
 (0)