Skip to content

Commit a706f54

Browse files
cpcloudjcrist
authored andcommitted
feat(datafusion): unnest
1 parent 327c194 commit a706f54

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

ibis/backends/sql/compilers/datafusion.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ class DataFusionCompiler(SQLGlotCompiler):
5757
ops.TimestampDelta,
5858
ops.TimestampNow,
5959
ops.TypeOf,
60-
ops.Unnest,
6160
ops.StringToDate,
6261
ops.StringToTimestamp,
6362
)

ibis/backends/tests/test_array.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ def test_array_discovery(backend):
258258
reason="BigQuery doesn't support casting array<T> to array<U>",
259259
raises=GoogleBadRequest,
260260
)
261-
@pytest.mark.notimpl(["datafusion"], raises=com.OperationNotDefinedError)
262261
def test_unnest_simple(backend):
263262
array_types = backend.array_types
264263
expected = (
@@ -274,7 +273,6 @@ def test_unnest_simple(backend):
274273

275274

276275
@builtin_array
277-
@pytest.mark.notimpl(["datafusion"], raises=com.OperationNotDefinedError)
278276
def test_unnest_complex(backend):
279277
array_types = backend.array_types
280278
df = array_types.execute()
@@ -303,7 +301,12 @@ def test_unnest_complex(backend):
303301

304302

305303
@builtin_array
306-
@pytest.mark.notimpl(["datafusion", "flink"], raises=com.OperationNotDefinedError)
304+
@pytest.mark.notimpl(["flink"], raises=com.OperationNotDefinedError)
305+
@pytest.mark.notyet(
306+
["datafusion"],
307+
raises=Exception,
308+
reason="Input field name ARRAY_AGG(t1.x) does not match with the projection expression",
309+
)
307310
def test_unnest_idempotent(backend):
308311
array_types = backend.array_types
309312
df = array_types.execute()
@@ -326,7 +329,12 @@ def test_unnest_idempotent(backend):
326329

327330

328331
@builtin_array
329-
@pytest.mark.notimpl(["datafusion", "flink"], raises=com.OperationNotDefinedError)
332+
@pytest.mark.notimpl(["flink"], raises=com.OperationNotDefinedError)
333+
@pytest.mark.notyet(
334+
["datafusion"],
335+
raises=Exception,
336+
reason="Input field name ARRAY_AGG(t1.x) does not match with the projection expression",
337+
)
330338
def test_unnest_no_nulls(backend):
331339
array_types = backend.array_types
332340
df = array_types.execute()
@@ -358,7 +366,6 @@ def test_unnest_no_nulls(backend):
358366
raises=ValueError,
359367
reason="all the input arrays must have same number of dimensions",
360368
)
361-
@pytest.mark.notimpl(["datafusion"], raises=com.OperationNotDefinedError)
362369
def test_unnest_default_name(backend):
363370
array_types = backend.array_types
364371
df = array_types.execute()
@@ -785,7 +792,6 @@ def test_array_intersect(con, data):
785792
@builtin_array
786793
@pytest.mark.notimpl(["postgres"], raises=PsycoPg2SyntaxError)
787794
@pytest.mark.notimpl(["risingwave"], raises=PsycoPg2InternalError)
788-
@pytest.mark.notimpl(["datafusion"], raises=com.OperationNotDefinedError)
789795
@pytest.mark.notimpl(
790796
["trino"], reason="inserting maps into structs doesn't work", raises=TrinoUserError
791797
)
@@ -805,7 +811,6 @@ def test_unnest_struct(con):
805811
@builtin_array
806812
@pytest.mark.notimpl(["postgres"], raises=PsycoPg2SyntaxError)
807813
@pytest.mark.notimpl(["risingwave"], raises=PsycoPg2InternalError)
808-
@pytest.mark.notimpl(["datafusion"], raises=com.OperationNotDefinedError)
809814
@pytest.mark.notimpl(
810815
["trino"], reason="inserting maps into structs doesn't work", raises=TrinoUserError
811816
)
@@ -896,7 +901,9 @@ def test_zip_null(con, fn):
896901
@builtin_array
897902
@pytest.mark.notimpl(["postgres"], raises=PsycoPg2SyntaxError)
898903
@pytest.mark.notimpl(["risingwave"], raises=PsycoPg2ProgrammingError)
899-
@pytest.mark.notimpl(["datafusion"], raises=com.OperationNotDefinedError)
904+
@pytest.mark.notimpl(
905+
["datafusion"], raises=Exception, reason="probably generating invalid SQL"
906+
)
900907
@pytest.mark.notimpl(
901908
["polars"],
902909
raises=com.OperationNotDefinedError,
@@ -1095,11 +1102,6 @@ def test_range_start_stop_step_zero(con, start, stop):
10951102
raises=AssertionError,
10961103
reason="ibis hasn't implemented this behavior yet",
10971104
)
1098-
@pytest.mark.notyet(
1099-
["datafusion"],
1100-
raises=com.OperationNotDefinedError,
1101-
reason="backend doesn't support unnest",
1102-
)
11031105
@pytest.mark.notyet(
11041106
["flink"],
11051107
raises=Py4JJavaError,

0 commit comments

Comments
 (0)