Skip to content

Commit

Permalink
chore(datafusion): remove use of deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Sep 17, 2024
1 parent 4c36ce6 commit 1b1000f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ibis/backends/datafusion/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ def _register_in_memory_table(self, op: ops.InMemoryTable) -> None:
# self.con.register_table is broken, so we do this roundabout thing
# of constructing a datafusion DataFrame, which has a side effect
# of registering the table
self.con.from_arrow_table(op.data.to_pyarrow(op.schema), op.name)
self.con.from_arrow(op.data.to_pyarrow(op.schema), op.name)

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


@_read_in_memory.register("pyarrow.RecordBatchReader")
def _pyarrow_rbr(source, table_name, _conn, overwrite: bool = False):
tmp_name = gen_name("pyarrow")
with _create_and_drop_memtable(_conn, table_name, tmp_name, overwrite):
_conn.con.from_arrow_table(source.read_all(), name=tmp_name)
_conn.con.from_arrow(source.read_all(), name=tmp_name)


@_read_in_memory.register("pyarrow.RecordBatch")
Expand Down

0 comments on commit 1b1000f

Please sign in to comment.