Skip to content

Commit ecc199f

Browse files
cpcloudjcrist
authored andcommitted
fix(datafusion): handle NULLs in array flatten
1 parent 9ee910d commit ecc199f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

ibis/backends/sql/compilers/datafusion.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,5 +499,8 @@ def visit_GroupConcat(self, op, *, arg, sep, where, order_by):
499499
op, arg=arg, sep=sep, where=where, order_by=order_by
500500
)
501501

502+
def visit_ArrayFlatten(self, op, *, arg):
503+
return self.if_(arg.is_(NULL), NULL, self.f.flatten(arg))
504+
502505

503506
compiler = DataFusionCompiler()

ibis/backends/tests/test_array.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,6 @@ def flatten_data():
10331033
reason="Arrays are never nullable",
10341034
raises=AssertionError,
10351035
),
1036-
pytest.mark.notimpl(["datafusion"], raises=AssertionError),
10371036
],
10381037
),
10391038
param(
@@ -1051,7 +1050,6 @@ def flatten_data():
10511050
raises=TypeError,
10521051
reason="comparison of nested arrays doesn't work in pandas testing module",
10531052
),
1054-
pytest.mark.notimpl(["datafusion"], raises=AssertionError),
10551053
],
10561054
),
10571055
],

0 commit comments

Comments
 (0)