diff --git a/ibis/backends/polars/compiler.py b/ibis/backends/polars/compiler.py index 4d9a497191b4..4cdfd8714dfe 100644 --- a/ibis/backends/polars/compiler.py +++ b/ibis/backends/polars/compiler.py @@ -976,6 +976,13 @@ def array_concat(op, **kw): @translate.register(ops.Array) def array_column(op, **kw): cols = [translate(col, **kw) for col in op.exprs] + # Workaround for https://github.com/pola-rs/polars/issues/17294 + # pl.concat_list(Iterable[T]) results in pl.List[T], EXCEPT when T is a + # pl.List, in which case pl.concat_list(Iterable[pl.List[T]]) results in pl.List[T]. + # If polars ever supports a more consistent array constructor, + # we should switch to that. + if op.dtype.value_type.is_array(): + cols = [c.implode() for c in cols] return pl.concat_list(cols) diff --git a/ibis/backends/tests/test_array.py b/ibis/backends/tests/test_array.py index 1d3633a0e4ea..7e024c59c4b1 100644 --- a/ibis/backends/tests/test_array.py +++ b/ibis/backends/tests/test_array.py @@ -1352,14 +1352,7 @@ def test_unnest_range(con): [[1], ibis.literal([2])], [[1], [2]], id="array", - marks=[ - pytest.mark.notyet(["bigquery"], raises=GoogleBadRequest), - pytest.mark.broken( - ["polars"], - reason="expression input not supported with nested arrays", - raises=TypeError, - ), - ], + marks=[pytest.mark.notyet(["bigquery"], raises=GoogleBadRequest)], ), ], )