Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions diffly/comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +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",
# 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",
]
Comment thread
MoritzPotthoffQC marked this conversation as resolved.
24 changes: 14 additions & 10 deletions tests/test_fraction_same.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down