-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Fix URI Construction in Databricks Hook #53217
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
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
|
3c1f1be to
8272fc2
Compare
2d1514b to
eca4ae5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks for the PR and it LGTM overall
The conflict still need to be resolved, thanks.
providers/databricks/tests/unit/databricks/hooks/test_databricks_sql.py
Outdated
Show resolved
Hide resolved
providers/databricks/tests/unit/databricks/hooks/test_databricks_sql.py
Outdated
Show resolved
Hide resolved
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
|
I'm seeing a problem with OpenLineage extraction after that change when using DatabricksSqlOperator. OpenLineage is calling |
|
@kacpermuda Thanks for pointing that out. I found the issue: during testing, I mistakenly mocked get_conn to return an Airflow Connection, which allowed the incorrect sqlalchemy_url implementation to pass. I should be using |
Related Issue
related: #38195
Why
The default implementation of
DbApiHook.get_uridoes not conform to the standard Databricks connection format. Databricks typically uses token-based authentication (token:TOKEN) and expects the schema to be passed as a URL parameter, not directly in the path.How
Override
sqlalchemy_urlproperty to follow the official Databricks SQLAlchemy URI format documented here:https://docs.databricks.com/aws/en/dev-tools/sqlalchemy#authentication
Return the properly rendered SQLAlchemy URL in
get_uri.