Skip to content

Commit abb8709

Browse files
remove _max_or_zero
1 parent ab746e9 commit abb8709

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

diffly/comparison.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -723,8 +723,8 @@ def _max_list_lengths_by_column(self) -> dict[str, int]:
723723
if not (col_left and col_right):
724724
continue
725725
columns.append(col)
726-
left_exprs.append(_max_or_zero(col_left).alias(col))
727-
right_exprs.append(_max_or_zero(col_right).alias(col))
726+
left_exprs.append(pl.max_horizontal(col_left).alias(col))
727+
right_exprs.append(pl.max_horizontal(col_right).alias(col))
728728

729729
if not columns:
730730
return {}
@@ -859,12 +859,3 @@ def _list_length_exprs(
859859
for e in _list_length_exprs(expr.struct[field.name], field.dtype)
860860
]
861861
return []
862-
863-
864-
def _max_or_zero(exprs: list[pl.Expr]) -> pl.Expr:
865-
"""Return the horizontal max of scalar expressions, or literal 0 if empty."""
866-
if not exprs:
867-
return pl.lit(0)
868-
if len(exprs) == 1:
869-
return exprs[0]
870-
return pl.max_horizontal(exprs)

0 commit comments

Comments
 (0)