diff --git a/ibis/backends/__init__.py b/ibis/backends/__init__.py index 350937b5938b..ecec01a0bb15 100644 --- a/ibis/backends/__init__.py +++ b/ibis/backends/__init__.py @@ -1425,10 +1425,15 @@ def connect(resource: Path | str, **kwargs: Any) -> BaseBackend: return ibis.duckdb.connect(path, **kwargs) elif path.endswith((".sqlite", ".db")): return ibis.sqlite.connect(path, **kwargs) - elif path.endswith((".parquet", ".csv", ".csv.gz")): - # Load parquet/csv/csv.gz files with duckdb by default + elif path.endswith((".csv", ".csv.gz")): + # Load csv/csv.gz files with duckdb by default con = ibis.duckdb.connect(**kwargs) - con.register(path) + con.read_csv(path) + return con + elif path.endswith(".parquet"): + # Load parquet files with duckdb by default + con = ibis.duckdb.connect(**kwargs) + con.read_parquet(path) return con else: raise ValueError(f"Don't know how to connect to {resource!r}") diff --git a/ibis/backends/duckdb/tests/test_client.py b/ibis/backends/duckdb/tests/test_client.py index dbdbfc30ee57..b4c357557f76 100644 --- a/ibis/backends/duckdb/tests/test_client.py +++ b/ibis/backends/duckdb/tests/test_client.py @@ -270,9 +270,7 @@ def test_connect_local_file(out_method, extension, tmp_path): df = pd.DataFrame({"a": [1, 2, 3]}) path = tmp_path / f"out.{extension}" getattr(df, out_method)(path) - with pytest.warns(FutureWarning, match="v9.1"): - # ibis.connect uses con.register - con = ibis.connect(path) + con = ibis.connect(path) t = next(iter(con.tables.values())) assert not t.head().execute().empty