Skip to content

Reuse existing ORM session when resolving OpenLineage dag_team_name#70452

Open
SameerMesiah97 wants to merge 2 commits into
apache:mainfrom
SameerMesiah97:OpenLineage-Team-Name-Metrics-Fix
Open

Reuse existing ORM session when resolving OpenLineage dag_team_name#70452
SameerMesiah97 wants to merge 2 commits into
apache:mainfrom
SameerMesiah97:OpenLineage-Team-Name-Metrics-Fix

Conversation

@SameerMesiah97

@SameerMesiah97 SameerMesiah97 commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Description

This is a follow-up to PR #69109, which introduced the dag_team_name field to the OpenLineage airflowDagRun run facet.

This change updates the OpenLineage provider to reuse the existing SQLAlchemy session associated with the DagRun when resolving the dag_team_name field.

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 DagRun session ensures the lookup participates in the surrounding transaction while continuing to emit the dag_team_name field correctly.

Tests

Updated the existing test_dag_run_team_name unit test to verify that the existing SQLAlchemy session associated with the DagRun is reused when resolving dag_team_name.

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: [GPT 5.5] following the guidelines

@SameerMesiah97
SameerMesiah97 force-pushed the OpenLineage-Team-Name-Metrics-Fix branch from aed48e6 to 2e12431 Compare July 25, 2026 21:34
@SameerMesiah97
SameerMesiah97 marked this pull request as ready for review July 25, 2026 22:51
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
SameerMesiah97 force-pushed the OpenLineage-Team-Name-Metrics-Fix branch from 2e12431 to 6dbc989 Compare July 26, 2026 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant