Skip to content

Commit

Permalink
ci(flink): update tests that involve unnest in Flink
Browse files Browse the repository at this point in the history
  • Loading branch information
chloeh13q committed Mar 20, 2024
1 parent 73d8a40 commit 84fd059
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
16 changes: 11 additions & 5 deletions ibis/backends/tests/test_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def test_unnest_simple(backend):


@builtin_array
@pytest.mark.notimpl(["datafusion", "flink"], raises=com.OperationNotDefinedError)
@pytest.mark.notimpl(["datafusion"], raises=com.OperationNotDefinedError)
def test_unnest_complex(backend):
array_types = backend.array_types
df = array_types.execute()
Expand Down Expand Up @@ -356,7 +356,7 @@ def test_unnest_no_nulls(backend):
raises=ValueError,
reason="all the input arrays must have same number of dimensions",
)
@pytest.mark.notimpl(["datafusion", "flink"], raises=com.OperationNotDefinedError)
@pytest.mark.notimpl(["datafusion"], raises=com.OperationNotDefinedError)
def test_unnest_default_name(backend):
array_types = backend.array_types
df = array_types.execute()
Expand Down Expand Up @@ -803,10 +803,13 @@ def test_array_intersect(con, data):
)
@pytest.mark.notimpl(["postgres"], raises=PsycoPg2SyntaxError)
@pytest.mark.notimpl(["risingwave"], raises=PsycoPg2InternalError)
@pytest.mark.notimpl(["datafusion", "flink"], raises=com.OperationNotDefinedError)
@pytest.mark.notimpl(["datafusion"], raises=com.OperationNotDefinedError)
@pytest.mark.broken(
["trino"], reason="inserting maps into structs doesn't work", raises=TrinoUserError
)
@pytest.mark.broken(
["flink"], raises=Py4JJavaError, reason="error on memtable compilation"
)
def test_unnest_struct(con):
data = {"value": [[{"a": 1}, {"a": 2}], [{"a": 3}, {"a": 4}]]}
t = ibis.memtable(data, schema=ibis.schema({"value": "!array<!struct<a: !int>>"}))
Expand Down Expand Up @@ -904,7 +907,7 @@ def test_zip_null(con, fn):
["trino"], reason="inserting maps into structs doesn't work", raises=TrinoUserError
)
@pytest.mark.broken(
["flink"], raises=Py4JJavaError, reason="cannot insert schema type ROW<MAP<k,v>>"
["flink"], raises=Py4JJavaError, reason="error on memtable compilation"
)
def test_array_of_struct_unnest(con):
jobs = ibis.memtable(
Expand Down Expand Up @@ -1082,10 +1085,13 @@ def test_range_start_stop_step_zero(con, start, stop):
reason="ibis hasn't implemented this behavior yet",
)
@pytest.mark.notyet(
["datafusion", "flink"],
["datafusion"],
raises=com.OperationNotDefinedError,
reason="backend doesn't support unnest",
)
@pytest.mark.broken(
["flink"], raises=Py4JJavaError, reason="error on memtable compilation"
)
def test_unnest_empty_array(con):
t = ibis.memtable({"arr": [[], ["a"], ["a", "b"]]})
expr = t.arr.unnest()
Expand Down
8 changes: 7 additions & 1 deletion ibis/backends/tests/test_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
MySQLProgrammingError,
OracleDatabaseError,
PsycoPg2InternalError,
Py4JJavaError,
PyDruidProgrammingError,
PyODBCDataError,
PyODBCProgrammingError,
Expand Down Expand Up @@ -1027,7 +1028,7 @@ def query(t, group_cols):


@pytest.mark.notimpl(
["dask", "pandas", "oracle", "flink", "exasol"], raises=com.OperationNotDefinedError
["dask", "pandas", "oracle", "exasol"], raises=com.OperationNotDefinedError
)
@pytest.mark.notimpl(["druid"], raises=AssertionError)
@pytest.mark.notyet(
Expand All @@ -1040,6 +1041,11 @@ def query(t, group_cols):
reason="invalid code generated for unnesting a struct",
raises=TrinoUserError,
)
@pytest.mark.broke(
["flink"],
reason="invalid code generated for unnesting a struct",
raises=Py4JJavaError,
)
def test_pivot_longer(backend):
diamonds = backend.diamonds
df = diamonds.execute()
Expand Down
1 change: 0 additions & 1 deletion ibis/backends/tests/test_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@ def test_map_length(con):
assert con.execute(expr) == 2


@pytest.mark.notimpl(["flink"], raises=exc.OperationNotDefinedError)
def test_map_keys_unnest(backend):
expr = backend.map.kv.keys().unnest()
result = expr.to_pandas()
Expand Down

0 comments on commit 84fd059

Please sign in to comment.