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

ISSUE-19651: handle starburst JWToken expiration #19689

Merged
merged 2 commits into from
Feb 7, 2025
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ def get_connection(connection: TrinoConnection) -> Engine:
# here we are creating a copy of connection, because we need to dynamically
# add auth params to connectionArguments, which we do no intend to store
# in original connection object and in OpenMetadata database
from trino.sqlalchemy.dialect import TrinoDialect

TrinoDialect.is_disconnect = _is_disconnect

connection_copy = deepcopy(connection)
if connection_copy.verify:
connection_copy.connectionArguments = (
Expand Down Expand Up @@ -183,3 +187,11 @@ def test_connection(
queries=queries,
timeout_seconds=timeout_seconds,
)


# pylint: disable=unused-argument
def _is_disconnect(self, e, connection, cursor):
"""is_disconnect method for the Databricks dialect"""
if "JWT expired" in str(e):
return True
return False
Loading