feat: Add OpenLineage support for DatabricksSqlHook#50392
Merged
mobuchowski merged 1 commit intoapache:mainfrom May 12, 2025
Merged
feat: Add OpenLineage support for DatabricksSqlHook#50392mobuchowski merged 1 commit intoapache:mainfrom
mobuchowski merged 1 commit intoapache:mainfrom
Conversation
6ed72e6 to
f06b569
Compare
593c1d4 to
2f2eef3
Compare
tatiana
reviewed
May 12, 2025
tatiana
reviewed
May 12, 2025
providers/databricks/src/airflow/providers/databricks/hooks/databricks_sql.py
Show resolved
Hide resolved
tatiana
reviewed
May 12, 2025
providers/databricks/src/airflow/providers/databricks/hooks/databricks_sql.py
Show resolved
Hide resolved
tatiana
reviewed
May 12, 2025
providers/databricks/src/airflow/providers/databricks/hooks/databricks_sql.py
Outdated
Show resolved
Hide resolved
tatiana
reviewed
May 12, 2025
providers/databricks/src/airflow/providers/databricks/hooks/databricks_sql.py
Show resolved
Hide resolved
tatiana
reviewed
May 12, 2025
providers/databricks/src/airflow/providers/databricks/operators/databricks_sql.py
Show resolved
Hide resolved
mobuchowski
approved these changes
May 12, 2025
Contributor
mobuchowski
left a comment
There was a problem hiding this comment.
Approved with non-blocking nits
providers/databricks/src/airflow/providers/databricks/operators/databricks_sql.py
Show resolved
Hide resolved
providers/databricks/src/airflow/providers/databricks/hooks/databricks_sql.py
Show resolved
Hide resolved
providers/databricks/src/airflow/providers/databricks/utils/openlineage.py
Show resolved
Hide resolved
tatiana
reviewed
May 12, 2025
providers/databricks/src/airflow/providers/databricks/utils/openlineage.py
Show resolved
Hide resolved
tatiana
reviewed
May 12, 2025
providers/databricks/src/airflow/providers/databricks/utils/openlineage.py
Show resolved
Hide resolved
tatiana
reviewed
May 12, 2025
providers/databricks/src/airflow/providers/databricks/utils/openlineage.py
Outdated
Show resolved
Hide resolved
tatiana
reviewed
May 12, 2025
providers/databricks/src/airflow/providers/databricks/utils/openlineage.py
Show resolved
Hide resolved
eladkal
reviewed
May 12, 2025
2f2eef3 to
1cc14b1
Compare
Contributor
Author
|
Thank you all for the input, I've answered all the comments and CI is green. Let me know if there is anything else that needs explanation or it's good to merge. |
tatiana
approved these changes
May 12, 2025
Contributor
tatiana
left a comment
There was a problem hiding this comment.
Thanks, @kacpermuda , for being so quick on replying and giving all the numbers!
sanederchik
pushed a commit
to sanederchik/airflow
that referenced
this pull request
Jun 7, 2025
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.
This PR adds OpenLineage support for
DatabricksSqlHookand thereforeDatabricksSqlOperator. It also introduces caching the hook on the operator level and gathering Databricks query_ids in the Hook when executing queries.The OpenLineage logic implemented in
DatabricksSqlHookis very similar to all other database Hooks already supported, and implementing a common interface fromDbApiHook:This PR also implements a very similar logic as in Snowflake provider on how to deal with multiple query_ids - we are sending pair of OpenLineage events for each query run, if there are more than one per operator run.
I've also updated the OpenLineage documentation to make it clear for the users how the support works for operators that inherit from SqlExecuteQueryOperator.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.