Reuse existing ORM session when resolving OpenLineage dag_team_name#70452
Open
SameerMesiah97 wants to merge 1 commit into
Open
Reuse existing ORM session when resolving OpenLineage dag_team_name#70452SameerMesiah97 wants to merge 1 commit into
SameerMesiah97 wants to merge 1 commit into
Conversation
Reuse the existing SQLAlchemy session associated with the DagRun when resolving the team name instead of creating a new managed session via @provide_session. This avoids an unexpected commit within the scheduler callback while continuing to emit the dag_team_name facet correctly.
SameerMesiah97
force-pushed
the
OpenLineage-Team-Name-Metrics-Fix
branch
from
July 25, 2026 21:34
aed48e6 to
2e12431
Compare
SameerMesiah97
marked this pull request as ready for review
July 25, 2026 22:51
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.
Description
This is a follow-up to PR #69109, which introduced the
dag_team_namefield to the OpenLineageairflowDagRunrun facet.This change updates the OpenLineage provider to reuse the existing SQLAlchemy session associated with the
DagRunwhen resolving thedag_team_namefield.Rationale
During manual testing, it was discovered that creating a new managed session triggered Airflow's HA lock protection by performing an unexpected commit within the scheduler callback. Reusing the existing
DagRunsession ensures the lookup participates in the surrounding transaction while continuing to emit thedag_team_namefield correctly.Tests
Updated the existing
test_dag_run_team_nameunit test to verify that the existing SQLAlchemy session associated with theDagRunis reused when resolvingdag_team_name.Was generative AI tooling used to co-author this PR?
Generated-by: [GPT 5.5] following the guidelines