Skip to content

Conversation

@BrianLii
Copy link
Contributor


Related: #53217

Update DatabricksSqlHook to use _get_token and self.host when constructing the SQLAlchemy URL, replacing the previous reliance on get_conn().

  • Remove dependency on get_conn() for retrieving tokens and host.
  • Update unit tests to reflect the change.

@BrianLii BrianLii reopened this Aug 14, 2025
@BrianLii BrianLii marked this pull request as ready for review August 14, 2025 08:43
@BrianLii
Copy link
Contributor Author

BrianLii commented Aug 14, 2025

OpenLineage is calling hook.get_sqlalchemy_engine() here, and it stopped working after this changes with error 'Connection' object has no attribute 'password'. The connection I have looks like databricks://@adb-XXX.10.azuredatabricks.net?token=XXX&http_path=/sql/1.0/warehouses/XXX.

@kacpermuda Could you check if this PR works for your scenario? I tested it by replacing the mock create_connection with the URL you provided.

@kacpermuda
Copy link
Contributor

Sure, let me test that and get back with the confirmation

@kacpermuda
Copy link
Contributor

Yeah, looks like it solved the problem in my use case. Thanks !

@mobuchowski mobuchowski merged commit 7f1fe81 into apache:main Aug 14, 2025
96 of 139 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants