Skip to content

Commit 8afddd2

Browse files
feedback copilot
1 parent abb8709 commit 8afddd2

2 files changed

Lines changed: 25 additions & 3 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: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,13 +435,31 @@ def test_condition_equal_columns_lists_only_inner() -> None:
435435
lhs = pl.DataFrame(
436436
{
437437
"pk": [1, 2],
438-
"a_left": [{"x": 1, "y": [1.0, 2.0, 3.0]}, {"x": 2, "y": [4.0, 5.0, 6.0]}],
438+
"a_left": [
439+
{
440+
"x": 1,
441+
"y": [1.0, 2.0, 3.0],
442+
},
443+
{
444+
"x": 2,
445+
"y": [4.0, 5.0, 6.0],
446+
},
447+
],
439448
},
440449
)
441450
rhs = pl.DataFrame(
442451
{
443452
"pk": [1, 2],
444-
"a_right": [{"x": 1, "y": [1.0, 2.1, 3.0]}, {"x": 2, "y": [4.0, 5.3, 6.0]}],
453+
"a_right": [
454+
{
455+
"x": 1,
456+
"y": [1.0, 2.1, 3.0],
457+
},
458+
{
459+
"x": 2,
460+
"y": [4.0, 5.3, 6.0],
461+
},
462+
],
445463
},
446464
)
447465

0 commit comments

Comments
 (0)