diff --git a/ibis/backends/dask/__init__.py b/ibis/backends/dask/__init__.py index c259cc352a4a..d754bd8440fc 100644 --- a/ibis/backends/dask/__init__.py +++ b/ibis/backends/dask/__init__.py @@ -30,14 +30,14 @@ class Backend(BasePandasBackend): def do_connect( self, - dictionary: MutableMapping[str, dd.DataFrame], + dictionary: MutableMapping[str, dd.DataFrame] | None = None, ) -> None: """Construct a Dask backend client from a dictionary of data sources. Parameters ---------- dictionary - Mapping from `str` table names to Dask DataFrames. + An optional mapping from `str` table names to Dask DataFrames. Examples -------- @@ -52,6 +52,9 @@ def do_connect( # register dispatchers from ibis.backends.dask import udf # noqa: F401 + if dictionary is None: + dictionary = {} + for k, v in dictionary.items(): if not isinstance(v, (dd.DataFrame, pd.DataFrame)): raise TypeError( diff --git a/ibis/backends/dask/tests/test_client.py b/ibis/backends/dask/tests/test_client.py index 3b9015f0d1e0..c19e343f5aeb 100644 --- a/ibis/backends/dask/tests/test_client.py +++ b/ibis/backends/dask/tests/test_client.py @@ -37,6 +37,11 @@ def table(client): return client.table('df') +def test_connect_no_args(): + con = ibis.dask.connect() + assert dict(con.tables) == {} + + def test_client_table(table): assert isinstance(table.op(), ibis.expr.operations.DatabaseTable) assert isinstance(table.op(), DaskTable)