Skip to content

Commit

Permalink
feat(pandas, polars, dask, datafusion): enable create local backends …
Browse files Browse the repository at this point in the history
…with empty url (#8860)

support empty URL for local backends in ibis.connect()

## Issues closed
* Resolves #8450
  • Loading branch information
jitingxu1 authored Apr 2, 2024
1 parent 80d12a2 commit 9dabae0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
20 changes: 18 additions & 2 deletions ibis/backends/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1458,5 +1458,21 @@ class NoUrl:

name: str

def _from_url(self, url: str, **_) -> ir.Table:
raise NotImplementedError(self.name)
def _from_url(self, url: str, **kwargs) -> BaseBackend:
"""Connect to the backend with empty url.
Parameters
----------
url : str
The URL with which to connect to the backend. This parameter is not used
in this method but is kept for consistency.
kwargs
Additional keyword arguments.
Returns
-------
BaseBackend
A backend instance
"""
return self.connect(**kwargs)
11 changes: 8 additions & 3 deletions ibis/backends/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,12 +711,12 @@ def test_unsigned_integer_type(con, temp_table):
),
param(
"dask://",
marks=[mark.dask, mark.xfail(raises=NotImplementedError)],
marks=mark.dask,
id="dask",
),
param(
"datafusion://",
marks=[mark.datafusion, mark.xfail(raises=NotImplementedError)],
marks=mark.datafusion,
id="datafusion",
),
param(
Expand All @@ -731,9 +731,14 @@ def test_unsigned_integer_type(con, temp_table):
),
param(
"pandas://",
marks=[mark.pandas, mark.xfail(raises=NotImplementedError)],
marks=mark.pandas,
id="pandas",
),
param(
"polars://",
marks=mark.polars,
id="polars",
),
param(
"postgres://postgres:postgres@localhost:5432",
marks=mark.postgres,
Expand Down

0 comments on commit 9dabae0

Please sign in to comment.