Skip to content

Commit ab746e9

Browse files
fix
1 parent 2ad8877 commit ab746e9

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

diffly/comparison.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -711,16 +711,16 @@ def _validate_subset_of_common_columns(self, subset: Iterable[str]) -> list[str]
711711

712712
@cached_property
713713
def _max_list_lengths_by_column(self) -> dict[str, int]:
714-
"""Max list length across all nesting levels, for columns where either side
715-
contains a List anywhere in its type tree."""
714+
"""Max list length across all nesting levels, for columns where both sides
715+
contain a List anywhere in their type tree."""
716716
left_exprs: list[pl.Expr] = []
717717
right_exprs: list[pl.Expr] = []
718718
columns: list[str] = []
719719

720720
for col in self._other_common_columns:
721721
col_left = _list_length_exprs(pl.col(col), self.left_schema[col])
722722
col_right = _list_length_exprs(pl.col(col), self.right_schema[col])
723-
if not col_left and not col_right:
723+
if not (col_left and col_right):
724724
continue
725725
columns.append(col)
726726
left_exprs.append(_max_or_zero(col_left).alias(col))

tests/test_conditions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def test_condition_equal_columns_list_array_with_tolerance(
103103
)
104104

105105
max_list_length: int | None = None
106-
if isinstance(lhs_type, pl.List) or isinstance(rhs_type, pl.List):
106+
if isinstance(lhs_type, pl.List) and isinstance(rhs_type, pl.List):
107107
max_list_length = 2
108108

109109
# Act
@@ -161,7 +161,7 @@ def test_condition_equal_columns_nested_list_array_with_tolerance(
161161
)
162162

163163
max_list_length: int | None = None
164-
if isinstance(lhs_type, pl.List) or isinstance(rhs_type, pl.List):
164+
if isinstance(lhs_type, pl.List) and isinstance(rhs_type, pl.List):
165165
max_list_length = 3
166166

167167
# Act

0 commit comments

Comments
 (0)