Skip to content

feat(api): make more connect() params kwarg-only or positional-only #11098

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ibis/backends/bigquery/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ def do_connect(
self,
project_id: str | None = None,
dataset_id: str = "",
*,
credentials: google.auth.credentials.Credentials | None = None,
application_name: str | None = None,
auth_local_webserver: bool = True,
Expand Down
1 change: 1 addition & 0 deletions ibis/backends/clickhouse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def _convert_kwargs(self, kwargs):

def do_connect(
self,
*,
host: str = "localhost",
port: int | None = None,
database: str = "default",
Expand Down
2 changes: 1 addition & 1 deletion ibis/backends/datafusion/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def version(self):
return importlib.metadata.version("datafusion")

def do_connect(
self, config: Mapping[str, str | Path] | SessionContext | None = None
self, config: Mapping[str, str | Path] | SessionContext | None = None, /
) -> None:
"""Create a DataFusion `Backend` for use with Ibis.

Expand Down
2 changes: 2 additions & 0 deletions ibis/backends/duckdb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,8 @@ def version(self) -> str:
def do_connect(
self,
database: str | Path = ":memory:",
/,
*,
read_only: bool = False,
extensions: Sequence[str] | None = None,
**config: Any,
Expand Down
1 change: 1 addition & 0 deletions ibis/backends/exasol/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def version(self) -> str:

def do_connect(
self,
*,
user: str,
password: str,
host: str = "localhost",
Expand Down
1 change: 1 addition & 0 deletions ibis/backends/impala/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def _from_url(self, url: ParseResult, **kwargs: Any) -> Backend:

def do_connect(
self,
*,
host: str = "localhost",
port: int = 21050,
database: str = "default",
Expand Down
1 change: 1 addition & 0 deletions ibis/backends/mssql/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def version(self) -> str:

def do_connect(
self,
*,
host: str = "localhost",
user: str | None = None,
password: str | None = None,
Expand Down
1 change: 1 addition & 0 deletions ibis/backends/mysql/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def version(self):

def do_connect(
self,
*,
host: str = "localhost",
user: str | None = None,
password: str | None = None,
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 @@ -38,7 +38,7 @@ def __init__(self, *args, **kwargs):
self._context = pl.SQLContext()

def do_connect(
self, tables: Mapping[str, pl.LazyFrame | pl.DataFrame] | None = None
self, tables: Mapping[str, pl.LazyFrame | pl.DataFrame] | None = None, /
) -> None:
"""Construct a client from a dictionary of polars `LazyFrame`s and/or `DataFrame`s.

Expand Down
1 change: 1 addition & 0 deletions ibis/backends/postgres/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ def version(self):

def do_connect(
self,
*,
host: str | None = None,
user: str | None = None,
password: str | None = None,
Expand Down
1 change: 1 addition & 0 deletions ibis/backends/pyspark/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def __init__(self, *args, **kwargs):
def do_connect(
self,
session: SparkSession | None = None,
*,
mode: ConnectionMode = "batch",
**kwargs,
) -> None:
Expand Down
1 change: 1 addition & 0 deletions ibis/backends/risingwave/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ def _safe_raw_sql(self, *args, **kwargs):

def do_connect(
self,
*,
host: str | None = None,
user: str | None = None,
password: str | None = None,
Expand Down
2 changes: 1 addition & 1 deletion ibis/backends/snowflake/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
AS
$$ {defn["source"]} $$"""

def do_connect(self, create_object_udfs: bool = True, **kwargs: Any):
def do_connect(self, *, create_object_udfs: bool = True, **kwargs: Any):

Check warning on line 242 in ibis/backends/snowflake/__init__.py

View check run for this annotation

Codecov / codecov/patch

ibis/backends/snowflake/__init__.py#L242

Added line #L242 was not covered by tests
"""Connect to Snowflake.

Parameters
Expand Down
2 changes: 2 additions & 0 deletions ibis/backends/sqlite/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ def version(self) -> str:
def do_connect(
self,
database: str | Path | None = None,
/,
*,
type_map: dict[str, str | dt.DataType] | None = None,
) -> None:
"""Create an Ibis client connected to a SQLite database.
Expand Down
1 change: 1 addition & 0 deletions ibis/backends/trino/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ def list_tables(

def do_connect(
self,
*,
user: str = "user",
password: str | None = None,
host: str = "localhost",
Expand Down
Loading