From 5790adc2316be84ebbf002e61ae2d323c1ac1de1 Mon Sep 17 00:00:00 2001 From: Moritz Potthoff Date: Tue, 28 Jul 2026 20:14:47 +0200 Subject: [PATCH 1/3] fix --- diffly/comparison.py | 9 ++++++--- pyproject.toml | 1 + tests/test_fraction_same.py | 24 ++++++++++++++---------- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/diffly/comparison.py b/diffly/comparison.py index 28e36f0..fc7b6c8 100644 --- a/diffly/comparison.py +++ b/diffly/comparison.py @@ -728,7 +728,7 @@ def equal(self, *, check_dtypes: bool = True) -> bool: return False return ( - pl.concat([left, right], how="horizontal") + pl.concat([left, right], how="horizontal_extend") .select( condition_equal_rows( columns=common_columns, @@ -1246,9 +1246,12 @@ def _list_length_exprs( """Collect max-list-length scalar expressions for every List level in the type tree.""" if isinstance(dtype, pl.List): - return [expr.list.len().max(), *_list_length_exprs(expr.explode(), dtype.inner)] + return [ + expr.list.len().max(), + *_list_length_exprs(expr.explode(empty_as_null=True), dtype.inner), + ] if isinstance(dtype, pl.Array): - return _list_length_exprs(expr.explode(), dtype.inner) + return _list_length_exprs(expr.explode(empty_as_null=True), dtype.inner) if isinstance(dtype, pl.Struct): return [ e diff --git a/pyproject.toml b/pyproject.toml index 6607266..a877221 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -96,3 +96,4 @@ default.extend-ignore-re = [ addopts = "--import-mode=importlib -m 'not generate'" markers = ["generate: mark a test function as generating fixture output."] testpaths = ["tests"] +filterwarnings = ["error"] diff --git a/tests/test_fraction_same.py b/tests/test_fraction_same.py index e578aa6..dd25b1f 100644 --- a/tests/test_fraction_same.py +++ b/tests/test_fraction_same.py @@ -30,20 +30,24 @@ def test_missing_primary_key_fraction_same() -> None: @pytest.mark.parametrize("frame_type", FRAME_TYPES) @pytest.mark.parametrize( "dtypes_left", - itertools.zip_longest( - FLOAT_DTYPES, - SIGNED_INTEGER_DTYPES, - UNSIGNED_INTEGER_DTYPES, - fillvalue=pl.Float32, + list( + itertools.zip_longest( + FLOAT_DTYPES, + SIGNED_INTEGER_DTYPES, + UNSIGNED_INTEGER_DTYPES, + fillvalue=pl.Float32, + ) ), ) @pytest.mark.parametrize( "dtypes_right", - itertools.zip_longest( - FLOAT_DTYPES, - SIGNED_INTEGER_DTYPES, - UNSIGNED_INTEGER_DTYPES, - fillvalue=pl.Float32, + list( + itertools.zip_longest( + FLOAT_DTYPES, + SIGNED_INTEGER_DTYPES, + UNSIGNED_INTEGER_DTYPES, + fillvalue=pl.Float32, + ) ), ) @pytest.mark.parametrize("parallel", [True, False]) From eafb75ccfe04fbbc466cf38bfe0ae4df913fdc60 Mon Sep 17 00:00:00 2001 From: Moritz Potthoff Date: Tue, 28 Jul 2026 20:18:58 +0200 Subject: [PATCH 2/3] fix --- diffly/comparison.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diffly/comparison.py b/diffly/comparison.py index fc7b6c8..0e4191e 100644 --- a/diffly/comparison.py +++ b/diffly/comparison.py @@ -728,7 +728,7 @@ def equal(self, *, check_dtypes: bool = True) -> bool: return False return ( - pl.concat([left, right], how="horizontal_extend") + pl.concat([left, right], how="horizontal", strict=True) .select( condition_equal_rows( columns=common_columns, From 74bd6531e83645159257a5080a2d5c05c7ca8f1e Mon Sep 17 00:00:00 2001 From: Moritz Potthoff Date: Tue, 28 Jul 2026 20:39:01 +0200 Subject: [PATCH 3/3] fix --- diffly/comparison.py | 2 +- pyproject.toml | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/diffly/comparison.py b/diffly/comparison.py index 0e4191e..e6c5e5d 100644 --- a/diffly/comparison.py +++ b/diffly/comparison.py @@ -728,7 +728,7 @@ def equal(self, *, check_dtypes: bool = True) -> bool: return False return ( - pl.concat([left, right], how="horizontal", strict=True) + pl.concat([left, right], how="horizontal") .select( condition_equal_rows( columns=common_columns, diff --git a/pyproject.toml b/pyproject.toml index a877221..2c49e05 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -96,4 +96,8 @@ default.extend-ignore-re = [ addopts = "--import-mode=importlib -m 'not generate'" markers = ["generate: mark a test function as generating fixture output."] testpaths = ["tests"] -filterwarnings = ["error"] +filterwarnings = [ + "error", + # polars' deprecation warning for horizontal concatenation cannot be solved, we are already using it correctly + "ignore:the default behavior of `how='horizontal'` for `concat` is deprecated:DeprecationWarning", +]