Skip to content

Commit e7cfc11

Browse files
fix(deps): update dependency datafusion to v41 (#10147)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Phillip Cloud <[email protected]>
1 parent b31fcc6 commit e7cfc11

File tree

7 files changed

+57
-34
lines changed

7 files changed

+57
-34
lines changed

ibis/backends/datafusion/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ def _register_in_memory_table(self, op: ops.InMemoryTable) -> None:
421421
# self.con.register_table is broken, so we do this roundabout thing
422422
# of constructing a datafusion DataFrame, which has a side effect
423423
# of registering the table
424-
self.con.from_arrow_table(op.data.to_pyarrow(op.schema), op.name)
424+
self.con.from_arrow(op.data.to_pyarrow(op.schema), op.name)
425425

426426
def read_csv(
427427
self, path: str | Path, table_name: str | None = None, **kwargs: Any
@@ -757,14 +757,14 @@ def _polars(source, table_name, _conn, overwrite: bool = False):
757757
def _pyarrow_table(source, table_name, _conn, overwrite: bool = False):
758758
tmp_name = gen_name("pyarrow")
759759
with _create_and_drop_memtable(_conn, table_name, tmp_name, overwrite):
760-
_conn.con.from_arrow_table(source, name=tmp_name)
760+
_conn.con.from_arrow(source, name=tmp_name)
761761

762762

763763
@_read_in_memory.register("pyarrow.RecordBatchReader")
764764
def _pyarrow_rbr(source, table_name, _conn, overwrite: bool = False):
765765
tmp_name = gen_name("pyarrow")
766766
with _create_and_drop_memtable(_conn, table_name, tmp_name, overwrite):
767-
_conn.con.from_arrow_table(source.read_all(), name=tmp_name)
767+
_conn.con.from_arrow(source.read_all(), name=tmp_name)
768768

769769

770770
@_read_in_memory.register("pyarrow.RecordBatch")

ibis/backends/tests/test_aggregation.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1586,7 +1586,9 @@ def test_grouped_case(backend, con):
15861586

15871587
@pytest.mark.notimpl(["polars"], raises=com.OperationNotDefinedError)
15881588
@pytest.mark.notimpl(
1589-
["datafusion"], raises=Exception, reason="not supported in datafusion"
1589+
["datafusion"],
1590+
raises=BaseException,
1591+
reason="because pyo3 panic exception is raised",
15901592
)
15911593
@pytest.mark.notyet(["flink"], raises=Py4JJavaError)
15921594
@pytest.mark.notyet(["impala"], raises=ImpalaHiveServer2Error)

ibis/backends/tests/test_map.py

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
["bigquery", "impala"], reason="Backend doesn't yet implement map types"
2222
),
2323
pytest.mark.notimpl(
24-
["datafusion", "exasol", "polars", "druid", "oracle"],
24+
["exasol", "polars", "druid", "oracle"],
2525
reason="Not yet implemented in ibis",
2626
),
2727
]
@@ -39,6 +39,10 @@
3939
reason="function hstore(character varying[], character varying[]) does not exist",
4040
)
4141

42+
mark_notyet_datafusion = pytest.mark.notyet(
43+
["datafusion"], raises=Exception, reason="only map and make_map are available"
44+
)
45+
4246

4347
@pytest.mark.notyet("clickhouse", reason="nested types can't be NULL")
4448
@pytest.mark.notimpl(
@@ -54,6 +58,7 @@
5458
param(None, None, id="null_both"),
5559
],
5660
)
61+
@mark_notyet_datafusion
5762
def test_map_nulls(con, k, v):
5863
k = ibis.literal(k, type="array<string>")
5964
v = ibis.literal(v, type="array<string>")
@@ -74,6 +79,7 @@ def test_map_nulls(con, k, v):
7479
param(None, None, id="null_both"),
7580
],
7681
)
82+
@mark_notyet_datafusion
7783
def test_map_keys_nulls(con, k, v):
7884
k = ibis.literal(k, type="array<string>")
7985
v = ibis.literal(v, type="array<string>")
@@ -106,6 +112,7 @@ def test_map_keys_nulls(con, k, v):
106112
param(ibis.literal(None, type="map<string, string>"), id="null_map"),
107113
],
108114
)
115+
@mark_notyet_datafusion
109116
def test_map_values_nulls(con, map):
110117
assert con.execute(map.values()) is None
111118

@@ -174,6 +181,7 @@ def test_map_values_nulls(con, map):
174181
],
175182
)
176183
@pytest.mark.parametrize("method", ["get", "contains"])
184+
@mark_notyet_datafusion
177185
def test_map_get_contains_nulls(con, map, key, method):
178186
expr = getattr(map, method)
179187
assert con.execute(expr(key)) is None
@@ -205,18 +213,21 @@ def test_map_get_contains_nulls(con, map, key, method):
205213
),
206214
],
207215
)
216+
@mark_notyet_datafusion
208217
def test_map_merge_nulls(con, m1, m2):
209218
concatted = m1 + m2
210219
assert con.execute(concatted) is None
211220

212221

222+
@mark_notyet_datafusion
213223
def test_map_table(backend):
214224
table = backend.map
215225
assert table.kv.type().is_map()
216226
assert not table.limit(1).execute().empty
217227

218228

219229
@mark_notimpl_risingwave_hstore
230+
@mark_notyet_datafusion
220231
def test_column_map_values(backend):
221232
table = backend.map
222233
expr = table.select("idx", vals=table.kv.values()).order_by("idx")
@@ -225,6 +236,7 @@ def test_column_map_values(backend):
225236
backend.assert_series_equal(result, expected)
226237

227238

239+
@mark_notyet_datafusion
228240
def test_column_map_merge(backend):
229241
table = backend.map
230242
expr = table.select(
@@ -239,6 +251,7 @@ def test_column_map_merge(backend):
239251

240252

241253
@mark_notimpl_risingwave_hstore
254+
@mark_notyet_datafusion
242255
def test_literal_map_keys(con):
243256
mapping = ibis.literal({"1": "a", "2": "b"})
244257
expr = mapping.keys().name("tmp")
@@ -250,6 +263,7 @@ def test_literal_map_keys(con):
250263

251264

252265
@mark_notimpl_risingwave_hstore
266+
@mark_notyet_datafusion
253267
def test_literal_map_values(con):
254268
mapping = ibis.literal({"1": "a", "2": "b"})
255269
expr = mapping.values().name("tmp")
@@ -260,6 +274,7 @@ def test_literal_map_values(con):
260274

261275
@mark_notimpl_risingwave_hstore
262276
@mark_notyet_postgres
277+
@mark_notyet_datafusion
263278
def test_scalar_isin_literal_map_keys(con):
264279
mapping = ibis.literal({"a": 1, "b": 2})
265280
a = ibis.literal("a")
@@ -272,6 +287,7 @@ def test_scalar_isin_literal_map_keys(con):
272287

273288
@mark_notimpl_risingwave_hstore
274289
@mark_notyet_postgres
290+
@mark_notyet_datafusion
275291
def test_map_scalar_contains_key_scalar(con):
276292
mapping = ibis.literal({"a": 1, "b": 2})
277293
a = ibis.literal("a")
@@ -283,6 +299,7 @@ def test_map_scalar_contains_key_scalar(con):
283299

284300

285301
@mark_notimpl_risingwave_hstore
302+
@mark_notyet_datafusion
286303
def test_map_scalar_contains_key_column(backend, alltypes, df):
287304
value = {"1": "a", "3": "c"}
288305
mapping = ibis.literal(value)
@@ -294,6 +311,7 @@ def test_map_scalar_contains_key_column(backend, alltypes, df):
294311

295312
@mark_notimpl_risingwave_hstore
296313
@mark_notyet_postgres
314+
@mark_notyet_datafusion
297315
def test_map_column_contains_key_scalar(backend, alltypes, df):
298316
expr = ibis.map(ibis.array([alltypes.string_col]), ibis.array([alltypes.int_col]))
299317
series = df.apply(lambda row: {row["string_col"]: row["int_col"]}, axis=1)
@@ -306,6 +324,7 @@ def test_map_column_contains_key_scalar(backend, alltypes, df):
306324

307325
@mark_notimpl_risingwave_hstore
308326
@mark_notyet_postgres
327+
@mark_notyet_datafusion
309328
def test_map_column_contains_key_column(alltypes):
310329
map_expr = ibis.map(
311330
ibis.array([alltypes.string_col]), ibis.array([alltypes.int_col])
@@ -317,6 +336,7 @@ def test_map_column_contains_key_column(alltypes):
317336

318337
@mark_notimpl_risingwave_hstore
319338
@mark_notyet_postgres
339+
@mark_notyet_datafusion
320340
def test_literal_map_merge(con):
321341
a = ibis.literal({"a": 0, "b": 2})
322342
b = ibis.literal({"a": 1, "c": 3})
@@ -326,6 +346,7 @@ def test_literal_map_merge(con):
326346

327347

328348
@mark_notimpl_risingwave_hstore
349+
@mark_notyet_datafusion
329350
def test_literal_map_getitem_broadcast(backend, alltypes, df):
330351
value = {"1": "a", "2": "b"}
331352

@@ -472,6 +493,7 @@ def test_literal_map_getitem_broadcast(backend, alltypes, df):
472493
@values
473494
@keys
474495
@mark_notimpl_risingwave_hstore
496+
@mark_notyet_datafusion
475497
def test_map_get_all_types(con, keys, values):
476498
m = ibis.map(ibis.array(keys), ibis.array(values))
477499
for key, val in zip(keys, values):
@@ -482,6 +504,7 @@ def test_map_get_all_types(con, keys, values):
482504

483505
@keys
484506
@mark_notimpl_risingwave_hstore
507+
@mark_notyet_datafusion
485508
def test_map_contains_all_types(con, keys):
486509
a = ibis.array(keys)
487510
m = ibis.map(a, a)
@@ -490,6 +513,7 @@ def test_map_contains_all_types(con, keys):
490513

491514

492515
@mark_notimpl_risingwave_hstore
516+
@mark_notyet_datafusion
493517
def test_literal_map_get_broadcast(backend, alltypes, df):
494518
value = {"1": "a", "2": "b"}
495519

@@ -524,13 +548,14 @@ def test_map_construct_dict(con, keys, values):
524548
assert result == dict(zip(keys, values))
525549

526550

527-
@mark_notimpl_risingwave_hstore
528-
@mark_notyet_postgres
529551
@pytest.mark.notimpl(
530552
["flink"],
531553
raises=pa.lib.ArrowInvalid,
532554
reason="Map array child array should have no nulls",
533555
)
556+
@mark_notimpl_risingwave_hstore
557+
@mark_notyet_postgres
558+
@mark_notyet_datafusion
534559
def test_map_construct_array_column(con, alltypes, df):
535560
expr = ibis.map(ibis.array([alltypes.string_col]), ibis.array([alltypes.int_col]))
536561
result = con.execute(expr)
@@ -541,6 +566,7 @@ def test_map_construct_array_column(con, alltypes, df):
541566

542567
@mark_notimpl_risingwave_hstore
543568
@mark_notyet_postgres
569+
@mark_notyet_datafusion
544570
def test_map_get_with_compatible_value_smaller(con):
545571
value = ibis.literal({"A": 1000, "B": 2000})
546572
expr = value.get("C", 3)
@@ -549,6 +575,7 @@ def test_map_get_with_compatible_value_smaller(con):
549575

550576
@mark_notimpl_risingwave_hstore
551577
@mark_notyet_postgres
578+
@mark_notyet_datafusion
552579
def test_map_get_with_compatible_value_bigger(con):
553580
value = ibis.literal({"A": 1, "B": 2})
554581
expr = value.get("C", 3000)
@@ -557,6 +584,7 @@ def test_map_get_with_compatible_value_bigger(con):
557584

558585
@mark_notimpl_risingwave_hstore
559586
@mark_notyet_postgres
587+
@mark_notyet_datafusion
560588
def test_map_get_with_incompatible_value_different_kind(con):
561589
value = ibis.literal({"A": 1000, "B": 2000})
562590
expr = value.get("C", 3.0)
@@ -565,6 +593,7 @@ def test_map_get_with_incompatible_value_different_kind(con):
565593

566594
@mark_notimpl_risingwave_hstore
567595
@mark_notyet_postgres
596+
@mark_notyet_datafusion
568597
@pytest.mark.parametrize("null_value", [None, ibis.null()])
569598
def test_map_get_with_null_on_not_nullable(con, null_value):
570599
map_type = dt.Map(dt.string, dt.Int16(nullable=False))
@@ -579,18 +608,20 @@ def test_map_get_with_null_on_not_nullable(con, null_value):
579608
["flink"], raises=Py4JJavaError, reason="Flink cannot handle typeless nulls"
580609
)
581610
@mark_notimpl_risingwave_hstore
611+
@mark_notyet_datafusion
582612
def test_map_get_with_null_on_null_type_with_null(con, null_value):
583613
value = ibis.literal({"A": None, "B": None})
584614
expr = value.get("C", null_value)
585615
result = con.execute(expr)
586616
assert pd.isna(result)
587617

588618

589-
@mark_notimpl_risingwave_hstore
590-
@mark_notyet_postgres
591619
@pytest.mark.notyet(
592620
["flink"], raises=Py4JJavaError, reason="Flink cannot handle typeless nulls"
593621
)
622+
@mark_notimpl_risingwave_hstore
623+
@mark_notyet_postgres
624+
@mark_notyet_datafusion
594625
def test_map_get_with_null_on_null_type_with_non_null(con):
595626
value = ibis.literal({"A": None, "B": None})
596627
expr = value.get("C", 1)
@@ -603,6 +634,7 @@ def test_map_get_with_null_on_null_type_with_non_null(con):
603634
reason="`tbl_properties` is required when creating table with schema",
604635
)
605636
@mark_notimpl_risingwave_hstore
637+
@mark_notyet_datafusion
606638
def test_map_create_table(con, temp_table):
607639
t = con.create_table(
608640
temp_table,
@@ -617,18 +649,21 @@ def test_map_create_table(con, temp_table):
617649
reason="No translation rule for <class 'ibis.expr.operations.maps.MapLength'>",
618650
)
619651
@mark_notimpl_risingwave_hstore
652+
@mark_notyet_datafusion
620653
def test_map_length(con):
621654
expr = ibis.literal(dict(a="A", b="B")).length()
622655
assert con.execute(expr) == 2
623656

624657

658+
@mark_notyet_datafusion
625659
def test_map_keys_unnest(backend):
626660
expr = backend.map.kv.keys().unnest()
627661
result = expr.to_pandas()
628662
assert frozenset(result) == frozenset("abcdef")
629663

630664

631665
@mark_notimpl_risingwave_hstore
666+
@mark_notyet_datafusion
632667
def test_map_contains_null(con):
633668
expr = ibis.map(["a"], ibis.literal([None], type="array<string>"))
634669
assert con.execute(expr.contains("a"))

ibis/backends/tests/tpc/ds/test_queries.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@
99
from ibis import _, coalesce, cumulative_window, date, ifelse, null, rank, union
1010
from ibis import literal as lit
1111
from ibis import selectors as s
12-
from ibis.backends.tests.errors import (
13-
ArrowNotImplementedError,
14-
ClickHouseDatabaseError,
15-
TrinoUserError,
16-
)
12+
from ibis.backends.tests.errors import ClickHouseDatabaseError, TrinoUserError
1713
from ibis.backends.tests.tpc.conftest import tpc_test
1814
from ibis.common.exceptions import OperationNotDefinedError
1915

@@ -1416,7 +1412,6 @@ def test_26(catalog_sales, customer_demographics, date_dim, item, promotion):
14161412

14171413

14181414
@tpc_test("ds")
1419-
@pytest.mark.notyet(["datafusion"], reason="Failed to plan")
14201415
def test_27(store_sales, customer_demographics, date_dim, store, item):
14211416
results = (
14221417
store_sales.join(customer_demographics, [("ss_cdemo_sk", "cd_demo_sk")])
@@ -1999,11 +1994,6 @@ def test_38(store_sales, catalog_sales, web_sales, date_dim, customer):
19991994

20001995

20011996
@tpc_test("ds")
2002-
@pytest.mark.notyet(
2003-
["datafusion"],
2004-
raises=ArrowNotImplementedError,
2005-
reason="Unsupported cast from double to null using function cast_null",
2006-
)
20071997
def test_39(inventory, item, warehouse, date_dim):
20081998
inv = (
20091999
inventory.join(item, [("inv_item_sk", "i_item_sk")])
@@ -4894,11 +4884,6 @@ def test_89(item, store_sales, date_dim, store):
48944884
).limit(100)
48954885

48964886

4897-
@pytest.mark.notyet(
4898-
["datafusion"],
4899-
raises=ArrowNotImplementedError,
4900-
reason="Unsupported cast from double to null using function cast_null",
4901-
)
49024887
@tpc_test("ds")
49034888
def test_90(web_sales, household_demographics, time_dim, web_page):
49044889
def am_pm(*, hour: int, name: str):

poetry.lock

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)