Fix DatabricksSqlHook sqlalchemy_url missing http_path from connection extra#69747
Open
Vamsi-klu wants to merge 1 commit into
Open
Fix DatabricksSqlHook sqlalchemy_url missing http_path from connection extra#69747Vamsi-klu wants to merge 1 commit into
Vamsi-klu wants to merge 1 commit into
Conversation
…n extra get_conn correctly resolved http_path from explicit arg, sql_endpoint_name API, and extra_dejson, but sqlalchemy_url only used explicit arg. This caused get_uri() to return URL without http_path when connection defined via UI extra, breaking SQLAlchemy usage. Centralize resolution in _resolve_http_path helper, allow extra lookup in property without triggering API call. Add tests for extra path. Fixes: apache#69031
Contributor
Author
|
Reviewers: @potiuk @kaxil (providers) + databricks maintainers. Fixes http_path not propagated to sqlalchemy_url. Fixes #69031 Drafted-by: Muse Spark 1.1; reviewed by @Vamsi-klu before posting |
Contributor
Author
|
Tested this PR branch locally in the Airflow UI with Breeze. Scenario exercised:
Result:
Screenshots are hosted on a dedicated assets-only branch in the fork. Connection Extra JSON configured Connection saved and filtered in the UI Scratch Dag run succeeded Task log showing Drafted-by: Codex (GPT-5.5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Problem
Databricks connection with http_path in extra JSON (common UI path) works for get_conn() but fails for sqlalchemy_url / get_uri() because latter only reads self._http_path (init arg), ignoring extra_dejson["http_path"] and sql_endpoint_name resolution.
Root cause in providers/databricks/src/airflow/providers/databricks/hooks/databricks_sql.py:
Existing tests only supply explicit http_path, no extra path test.
What I did
Impact
Testing
Fixes: #69031
Was generative AI tooling used to co-author this PR?
Generated-by: Muse Spark 1.1