Skip to content
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

feat(trino): wrap auth strings with BasicAuthentication #9960

Merged
merged 2 commits into from
Sep 3, 2024
Merged
Changes from 1 commit
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
9 changes: 8 additions & 1 deletion ibis/backends/trino/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import sqlglot as sg
import sqlglot.expressions as sge
import trino
from trino.auth import BasicAuthentication

import ibis
import ibis.backends.sql.compilers as sc
Expand Down Expand Up @@ -309,10 +310,16 @@ def do_connect(
raise ValueError(
"Cannot specify both `auth` and `password` when connecting to Trino"
)
else:
auth = password
warnings.warn(
"The `password` parameter is deprecated and will be removed in 10.0; use `auth` instead",
FutureWarning,
)

if isinstance(auth, str):
auth = BasicAuthentication(user, auth)

self.con = trino.dbapi.connect(
user=user,
host=host,
Expand All @@ -321,7 +328,7 @@ def do_connect(
schema=schema,
source=source or "ibis",
timezone=timezone,
auth=auth or password,
auth=auth,
**kwargs,
)

Expand Down
Loading