Skip to content

Commit

Permalink
fix(python/adbc_driver_snowflake): allow connecting without URI (#923)
Browse files Browse the repository at this point in the history
Fixes #890.
  • Loading branch information
lidavidm authored Jul 21, 2023
1 parent 6263cfd commit 97593da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,10 @@ def connect(
db_kwargs : dict, optional
Initial database connection parameters.
"""
return adbc_driver_manager.AdbcDatabase(
driver=_driver_path(), uri=uri, **(db_kwargs or {})
)
kwargs = (db_kwargs or {}).copy()
if uri is not None:
kwargs["uri"] = uri
return adbc_driver_manager.AdbcDatabase(driver=_driver_path(), **kwargs)


@functools.cache
Expand Down
4 changes: 2 additions & 2 deletions python/adbc_driver_snowflake/adbc_driver_snowflake/dbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@


def connect(
uri: str,
uri: typing.Optional[str] = None,
db_kwargs: typing.Optional[typing.Dict[str, str]] = None,
conn_kwargs: typing.Optional[typing.Dict[str, str]] = None,
**kwargs,
Expand All @@ -103,7 +103,7 @@ def connect(
Parameters
----------
uri : str
uri : str, optional
The URI to connect to.
db_kwargs : dict, optional
Initial database connection parameters.
Expand Down

0 comments on commit 97593da

Please # to comment.