-
Notifications
You must be signed in to change notification settings - Fork 409
Adding query ID's for dbt #3890
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
|
Thanks for opening your first OpenLineage pull request! We appreciate your contribution. If you haven't already, please make sure you've reviewed our guide for new contributors (https://github.com/OpenLineage/OpenLineage/blob/main/CONTRIBUTING.md). |
tatiana
left a comment
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.
Thanks for working on this, @jroachgolf84! We may need to add some tests to cover this change. We may have to update the documentation - is the facet externalQuery new or did it exist before?
@kacpermuda please, could you take a look and give feedback?
|
@jroachgolf84 some other connectors are using different fields, like BigQuery and Glue, could you make this field depend on adapter type? https://github.com/dbt-labs/dbt-bigquery/blob/0995665e490cdee9c408d26aac8e1c19fefaebe0/dbt/adapters/bigquery/connections.py#L62C1-L63C1 |
Agreed! There are very few unit-tests to be found for dbt, and not speficially for the |
@mobuchowski - for these adapters, is the field name not |
|
@jroachgolf84 I've looked at few, and |
|
@mobuchowski, perfect, thanks for the heads up. I'll go ahead and update accordingly. Do you have any recommendations on the best way to test this? I'd lean towards writing tests only for the |
|
@jroachgolf84 we've just added new dbt integration tests: #3872 however they only run duckdb adapter, and it does not include query id in the adapter response. |
|
@mobuchowski, I will most certainly take a look at this. In the meantime, do you have any docs about actually executing unit-tests that have been written already? |
|
@mobuchowski, I've gone ahead and added unit-tests for my changes to the |
2d78745 to
09edfce
Compare
kacpermuda
left a comment
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.
Added some comments. It looks good, but maybe we can improve the default path a bit to support more cases.
integration/common/openlineage/common/provider/dbt/processor.py
Outdated
Show resolved
Hide resolved
integration/common/openlineage/common/provider/dbt/processor.py
Outdated
Show resolved
Hide resolved
integration/common/openlineage/common/provider/dbt/processor.py
Outdated
Show resolved
Hide resolved
integration/common/openlineage/common/provider/dbt/processor.py
Outdated
Show resolved
Hide resolved
integration/common/openlineage/common/provider/dbt/processor.py
Outdated
Show resolved
Hide resolved
Signed-off-by: jroachgolf84 <[email protected]>
Signed-off-by: jroachgolf84 <[email protected]>
Signed-off-by: jroachgolf84 <[email protected]>
Signed-off-by: jroachgolf84 <[email protected]>
Signed-off-by: jroachgolf84 <[email protected]>
31c947d to
4f81939
Compare
|
@kacpermuda, I've implemented each of the changes you outlined. Do you mind taking another look? |
kacpermuda
left a comment
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.
LGTM
|
Great job! Congrats on your first merged pull request in OpenLineage! |
|
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #3890 +/- ##
==========================================
+ Coverage 85.06% 85.11% +0.05%
==========================================
Files 57 57
Lines 3809 3822 +13
==========================================
+ Hits 3240 3253 +13
Misses 569 569 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Problem
In Airflow, operators like the
SqlExecuteQueryOperatoremit rich lineage data, including query ID. This query ID is not available when using the Astronomer Cosmos project in Airflow.Closes: NONE
Solution
By parsing the
run_results, we're able to parse thequery_idfrom theadapter_response. This is then added to theexternalQueryinrun_facets. This provides the same functionality as what is seen in theSQLExecuteQueryOperator.One-line summary: Adding query ID's for
dbtChecklist
SPDX-License-Identifier: Apache-2.0
Copyright 2018-2025 contributors to the OpenLineage project