dbt: propagate root parent through dbt-run wrapper to child events#4522
Merged
mobuchowski merged 2 commits intoMay 8, 2026
Merged
Conversation
The legacy `consume_local_artifacts` path constructs `dbt_run_metadata` without `root_parent_*` fields, so every per-node event uses `self._dbt_run_metadata.to_openlineage()` and ends up with `root=None` in its parent facet. Backends lose the orchestrator → dbt-run → node stitching and the dbt-run wrapper appears as a free-floating root sibling of Airflow instead of its child. Carry the root parent through: - when there's an external orchestrator (`OPENLINEAGE_PARENT_ID` set), inherit its root (or its own identity if no `OPENLINEAGE_ROOT_PARENT_ID`) - when there's no orchestrator, the dbt-run wrapper itself is the root Mirrors the structured-logs path's `_setup_dbt_run_metadata`, which already extracts root from the start event's parent facet. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Maciej Obuchowski <maciej.obuchowski@datadoghq.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4522 +/- ##
=======================================
Coverage 73.06% 73.06%
=======================================
Files 21 21
Lines 2291 2291
=======================================
Hits 1674 1674
Misses 617 617 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
kacpermuda
reviewed
May 8, 2026
kacpermuda
reviewed
May 8, 2026
kacpermuda
reviewed
May 8, 2026
…rtifacts When propagating root parent metadata to per-node events, use root values only when all three fields (run_id, job_name, job_namespace) are present. Previously, field-by-field or fallbacks could mix a root run_id with a parent job_name, producing an incoherent reference. Add tests for explicit root distinct from parent, and for partial/malformed OPENLINEAGE_ROOT_PARENT_ID falling back entirely to immediate parent values. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Maciej Obuchowski <maciej.obuchowski@datadoghq.com>
kacpermuda
approved these changes
May 8, 2026
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.
The legacy
consume_local_artifactspath constructsdbt_run_metadatawithoutroot_parent_*fields, so every per-node event usesself._dbt_run_metadata.to_openlineage()and ends up withroot=Nonein its parent facet.Checklist