From 158a7717cf6ee42fd1417f052319f7877d94d752 Mon Sep 17 00:00:00 2001 From: Gil Forsyth Date: Mon, 22 Jul 2024 17:08:37 -0400 Subject: [PATCH] refactor(duckdb): deprecate `read_in_memory` This functionality is available via `create_table` (and also available across all backends instead of just DuckDB). --- ibis/backends/duckdb/__init__.py | 6 +++++- ibis/backends/tests/test_register.py | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ibis/backends/duckdb/__init__.py b/ibis/backends/duckdb/__init__.py index 8f23c3bce534c..37975b03d0572 100644 --- a/ibis/backends/duckdb/__init__.py +++ b/ibis/backends/duckdb/__init__.py @@ -851,8 +851,12 @@ def _read_parquet_pyarrow_dataset( # by the time we execute against this so we register it # explicitly. + @util.deprecated( + instead="Pass in-memory data to `create_table` instead.", + as_of="9.1", + removed_in="10.0", + ) def read_in_memory( - # TODO: deprecate this in favor of `create_table` self, source: pd.DataFrame | pa.Table diff --git a/ibis/backends/tests/test_register.py b/ibis/backends/tests/test_register.py index 64d8b23792b98..cdfa1683743f2 100644 --- a/ibis/backends/tests/test_register.py +++ b/ibis/backends/tests/test_register.py @@ -277,7 +277,9 @@ def test_register_iterator_parquet( assert table.count().execute() -# TODO: modify test to use read_in_memory when implemented xref: 8858 +# TODO: remove entirely when `register` is removed +# This same functionality is implemented across all backends +# via `create_table` and tested in `test_client.py` @pytest.mark.notimpl(["datafusion"]) @pytest.mark.notyet( [ @@ -311,7 +313,9 @@ def test_register_pandas(con): assert t.x.sum().execute() == 6 -# TODO: modify test to use read_in_memory when implemented xref: 8858 +# TODO: remove entirely when `register` is removed +# This same functionality is implemented across all backends +# via `create_table` and tested in `test_client.py` @pytest.mark.notimpl(["datafusion", "polars"]) @pytest.mark.notyet( [