Skip to content

Commit

Permalink
chore: bump deprecation version to 9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ncclementi committed May 28, 2024
1 parent 3102cd6 commit 0608259
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion ibis/backends/datafusion/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def get_schema(
return sch.schema(table.schema)

@deprecated(
as_of="9.0",
as_of="9.1",
instead="use the explicit `read_*` method for the filetype you are trying to read, e.g., read_parquet, read_csv, etc.",
)
def register(
Expand Down
4 changes: 2 additions & 2 deletions ibis/backends/datafusion/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ def _load_data(self, **_: Any) -> None:
con = self.connection
for table_name in TEST_TABLES:
path = self.data_dir / "parquet" / f"{table_name}.parquet"
with pytest.warns(FutureWarning, match="v9.0"):
with pytest.warns(FutureWarning, match="v9.1"):
con.register(path, table_name=table_name)
# TODO: remove warnings and replace register when implementing 8858
with pytest.warns(FutureWarning, match="v9.0"):
with pytest.warns(FutureWarning, match="v9.1"):
con.register(array_types, table_name="array_types")
con.register(win, table_name="win")
con.register(topk, table_name="topk")
Expand Down
4 changes: 2 additions & 2 deletions ibis/backends/datafusion/tests/test_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ def test_none_config():
def test_str_config(name_to_path):
config = {name: str(path) for name, path in name_to_path.items()}
# if path.endswith((".parquet", ".csv", ".csv.gz")) connect triggers register
with pytest.warns(FutureWarning, match="v9.0"):
with pytest.warns(FutureWarning, match="v9.1"):
conn = ibis.datafusion.connect(config)
assert sorted(conn.list_tables()) == sorted(name_to_path)


def test_path_config(name_to_path):
config = name_to_path
# if path.endswith((".parquet", ".csv", ".csv.gz")) connect triggers register
with pytest.warns(FutureWarning, match="v9.0"):
with pytest.warns(FutureWarning, match="v9.1"):
conn = ibis.datafusion.connect(config)
assert sorted(conn.list_tables()) == sorted(name_to_path)

Expand Down
8 changes: 4 additions & 4 deletions ibis/backends/datafusion/tests/test_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,28 @@ def test_read_parquet(conn, data_dir):

def test_register_table(conn):
tab = pa.table({"x": [1, 2, 3]})
with pytest.warns(FutureWarning, match="v9.0"):
with pytest.warns(FutureWarning, match="v9.1"):
conn.register(tab, "my_table")
assert conn.table("my_table").x.sum().execute() == 6


def test_register_pandas(conn):
df = pd.DataFrame({"x": [1, 2, 3]})
with pytest.warns(FutureWarning, match="v9.0"):
with pytest.warns(FutureWarning, match="v9.1"):
conn.register(df, "my_table")
assert conn.table("my_table").x.sum().execute() == 6


def test_register_batches(conn):
batch = pa.record_batch([pa.array([1, 2, 3])], names=["x"])
with pytest.warns(FutureWarning, match="v9.0"):
with pytest.warns(FutureWarning, match="v9.1"):
conn.register(batch, "my_table")
assert conn.table("my_table").x.sum().execute() == 6


def test_register_dataset(conn):
tab = pa.table({"x": [1, 2, 3]})
dataset = ds.InMemoryDataset(tab)
with pytest.warns(FutureWarning, match="v9.0"):
with pytest.warns(FutureWarning, match="v9.1"):
conn.register(dataset, "my_table")
assert conn.table("my_table").x.sum().execute() == 6
2 changes: 1 addition & 1 deletion ibis/backends/duckdb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ def drop_database(
pass

@deprecated(
as_of="9.0",
as_of="9.1",
instead="use the explicit `read_*` method for the filetype you are trying to read, e.g., read_parquet, read_csv, etc.",
)
def register(
Expand Down
2 changes: 1 addition & 1 deletion ibis/backends/duckdb/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def test_connect_duckdb(url, tmp_path):
)
def test_connect_local_file(out_method, extension, test_employee_data_1, tmp_path):
getattr(test_employee_data_1, out_method)(tmp_path / f"out.{extension}")
with pytest.warns(FutureWarning, match="v9.0"):
with pytest.warns(FutureWarning, match="v9.1"):
# ibis.connect uses con.register
con = ibis.connect(tmp_path / f"out.{extension}")
t = next(iter(con.tables.values()))
Expand Down
2 changes: 1 addition & 1 deletion ibis/backends/duckdb/tests/test_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def test_register_sqlite(con, tmp_path):
path = tmp_path / "test.db"
sqlite_con = sqlite3.connect(str(path))
sqlite_con.execute("CREATE TABLE t AS SELECT 1 a UNION SELECT 2 UNION SELECT 3")
with pytest.warns(FutureWarning, match="v9.0"):
with pytest.warns(FutureWarning, match="v9.1"):
ft = con.register(f"sqlite://{path}", "t")
assert ft.count().execute()

Expand Down
2 changes: 1 addition & 1 deletion ibis/backends/polars/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def table(self, name: str, _schema: sch.Schema | None = None) -> ir.Table:
return ops.DatabaseTable(name, schema, self).to_expr()

@deprecated(
as_of="9.0",
as_of="9.1",
instead="use the explicit `read_*` method for the filetype you are trying to read, e.g., read_parquet, read_csv, etc.",
)
def register(
Expand Down
4 changes: 2 additions & 2 deletions ibis/backends/polars/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ def _load_data(self, **_: Any) -> None:
con = self.connection
for table_name in TEST_TABLES:
path = self.data_dir / "parquet" / f"{table_name}.parquet"
with pytest.warns(FutureWarning, match="v9.0"):
with pytest.warns(FutureWarning, match="v9.1"):
con.register(path, table_name=table_name)
# TODO: remove warnings and replace register when implementing 8858
with pytest.warns(FutureWarning, match="v9.0"):
with pytest.warns(FutureWarning, match="v9.1"):
con.register(array_types, table_name="array_types")
con.register(struct_types, table_name="struct")
con.register(win, table_name="win")
Expand Down
2 changes: 1 addition & 1 deletion ibis/backends/pyspark/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ def read_json(
return self.table(table_name)

@deprecated(

Check warning on line 743 in ibis/backends/pyspark/__init__.py

View check run for this annotation

Codecov / codecov/patch

ibis/backends/pyspark/__init__.py#L743

Added line #L743 was not covered by tests
as_of="9.0",
as_of="9.1",
instead="use the explicit `read_*` method for the filetype you are trying to read, e.g., read_parquet, read_csv, etc.",
)
def register(
Expand Down
18 changes: 9 additions & 9 deletions ibis/backends/tests/test_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def gzip_csv(data_dir, tmp_path):
)
def test_register_csv(con, data_dir, fname, in_table_name, out_table_name):
with pushd(data_dir / "csv"):
with pytest.warns(FutureWarning, match="v9.0"):
with pytest.warns(FutureWarning, match="v9.1"):
table = con.register(fname, table_name=in_table_name)

assert any(out_table_name in t for t in con.list_tables())
Expand Down Expand Up @@ -129,7 +129,7 @@ def test_register_csv(con, data_dir, fname, in_table_name, out_table_name):
)
def test_register_csv_gz(con, data_dir, gzip_csv):
with pushd(data_dir):
with pytest.warns(FutureWarning, match="v9.0"):
with pytest.warns(FutureWarning, match="v9.1"):
table = con.register(gzip_csv)

assert table.count().execute()
Expand Down Expand Up @@ -159,7 +159,7 @@ def test_register_with_dotted_name(con, data_dir, tmp_path):
f.parent.mkdir()
data = data_dir.joinpath("csv", "diamonds.csv").read_bytes()
f.write_bytes(data)
with pytest.warns(FutureWarning, match="v9.0"):
with pytest.warns(FutureWarning, match="v9.1"):
table = con.register(str(f.absolute()))

if con.name != "datafusion":
Expand Down Expand Up @@ -223,7 +223,7 @@ def test_register_parquet(
pq.write_table(table, tmp_path / fname.name)

with pushd(tmp_path):
with pytest.warns(FutureWarning, match="v9.0"):
with pytest.warns(FutureWarning, match="v9.1"):
table = con.register(f"parquet://{fname.name}", table_name=in_table_name)

assert any(out_table_name in t for t in con.list_tables())
Expand Down Expand Up @@ -264,7 +264,7 @@ def test_register_iterator_parquet(
pq.write_table(table, tmp_path / "functional_alltypes.parquet")

with pushd(tmp_path):
with pytest.warns(FutureWarning, match="v9.0"):
with pytest.warns(FutureWarning, match="v9.1"):
table = con.register(
[
"parquet://functional_alltypes.parquet",
Expand Down Expand Up @@ -301,11 +301,11 @@ def test_register_pandas(con):
pd = pytest.importorskip("pandas")
df = pd.DataFrame({"x": [1, 2, 3], "y": ["a", "b", "c"]})

with pytest.warns(FutureWarning, match="v9.0"):
with pytest.warns(FutureWarning, match="v9.1"):
t = con.register(df)
assert t.x.sum().execute() == 6

with pytest.warns(FutureWarning, match="v9.0"):
with pytest.warns(FutureWarning, match="v9.1"):
t = con.register(df, "my_table")
assert t.op().name == "my_table"
assert t.x.sum().execute() == 6
Expand Down Expand Up @@ -335,7 +335,7 @@ def test_register_pyarrow_tables(con):
pa = pytest.importorskip("pyarrow")
pa_t = pa.Table.from_pydict({"x": [1, 2, 3], "y": ["a", "b", "c"]})

with pytest.warns(FutureWarning, match="v9.0"):
with pytest.warns(FutureWarning, match="v9.1"):
t = con.register(pa_t)
assert t.x.sum().execute() == 6

Expand Down Expand Up @@ -369,7 +369,7 @@ def test_csv_reregister_schema(con, tmp_path):
]
)

with pytest.warns(FutureWarning, match="v9.0"):
with pytest.warns(FutureWarning, match="v9.1"):
# For a full file scan, expect correct schema based on final row
foo_table = con.register(foo, table_name="same")
result_schema = foo_table.schema()
Expand Down

0 comments on commit 0608259

Please sign in to comment.