Skip to content

[v3-4-test] Snowflake, Databricks: emit query lineage via OpenLineage public API (#73655) - #76450

Merged
potiuk merged 1 commit into
v3-4-testfrom
backport-22f86cb-v3-4-test
Nov 4, 2026
Merged

potiuk merged 1 commit into
v3-4-testfrom
backport-22f86cb-v3-4-test

Conversation

@vatsrahul1001

Copy link
Copy Markdown
Contributor

Backport of #73655 ("Snowflake, Databricks: emit query lineage via OpenLineage public API") to v3-4-test.

Why: the OpenLineage e2e (openlineage_policy_hook_lineage_dag → check_events) was failing on v3-4-test full-test PRs (e.g. #76431, #76436). Root cause (confirmed with OL maintainer): the e2e PROD image runs the latest released OL provider, which includes #73655 renaming SQL hook-lineage query jobs from <dag>.<task>.query.N to <dag>.<task>.hll_query.N, but v3-4-test's in-tree tests still expected query.N → mismatch ("no events emitted"). This backport brings both the provider-source rename and the matching expected-events to v3-4-test, realigning them with the released provider.

Scope: 15 files — snowflake, databricks, and openlineage provider source + their unit/system tests + expected-events. Clean cherry-pick (no conflicts).

This is the targeted fix for the t_with_sql_hook.query.1 → hll_query.1 failure. Other OL e2e DAGs, if any still fail, may need additional test backports (tracked separately).


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.8) assisted with preparing the backport.

Generated-by: Claude Code (Opus 4.8)

…73655)

* Snowflake, Databricks: emit query lineage via OpenLineage public API

Snowflake and Databricks each duplicated their own logic for building
and emitting per-query OpenLineage lineage events, instead of using
the OpenLineage provider's own public API for that. This replaces
both with calls to the provider's `emit_query_lineage` API.

This also fixes a bug where the START and COMPLETE events for a query
shared a single mutable Run/Job object, letting a facet added while
emitting one event leak into, or get corrupted alongside, the other.

* Fix expected-events fixture for the SQL hook-lineage job rename

The hook-lineage query sub-job name changed from "...query.N" to
"...hll_query.N" to avoid colliding with the "...query.N" naming used
by the Snowflake/Databricks query-lineage emitters added in this PR.
The policy/hook-lineage e2e fixture still expected the old name.

* Bump openlineage version in pyproject.toml

* pre commit

# Conflicts:
#	uv.lock

* address review comments

(cherry picked from commit 22f86cb)
@potiuk
potiuk enabled auto-merge (squash) November 4, 2026 14:12
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

⚠️ 1 job(s) of attempt 1 were stopped because AWS reclaimed their EC2 Spot instances. These are not test failures.

RunsOn re-runs them automatically when the run finishes; no action is needed.

@potiuk
potiuk disabled auto-merge November 4, 2026 14:48
@potiuk
potiuk merged commit 7746477 into v3-4-test Nov 4, 2026
220 of 226 checks passed
@potiuk
potiuk deleted the backport-22f86cb-v3-4-test branch November 4, 2026 14:49
vatsrahul1001 added a commit that referenced this pull request Nov 4, 2026
…73655) (#76450)

* Snowflake, Databricks: emit query lineage via OpenLineage public API

Snowflake and Databricks each duplicated their own logic for building
and emitting per-query OpenLineage lineage events, instead of using
the OpenLineage provider's own public API for that. This replaces
both with calls to the provider's `emit_query_lineage` API.

This also fixes a bug where the START and COMPLETE events for a query
shared a single mutable Run/Job object, letting a facet added while
emitting one event leak into, or get corrupted alongside, the other.

* Fix expected-events fixture for the SQL hook-lineage job rename

The hook-lineage query sub-job name changed from "...query.N" to
"...hll_query.N" to avoid colliding with the "...query.N" naming used
by the Snowflake/Databricks query-lineage emitters added in this PR.
The policy/hook-lineage e2e fixture still expected the old name.

* Bump openlineage version in pyproject.toml

* pre commit

# Conflicts:
#	uv.lock

* address review comments

(cherry picked from commit 22f86cb)

Co-authored-by: Kacper Muda <[email protected]>
vatsrahul1001 added a commit that referenced this pull request Nov 5, 2026
…73655) (#76450)

* Snowflake, Databricks: emit query lineage via OpenLineage public API

Snowflake and Databricks each duplicated their own logic for building
and emitting per-query OpenLineage lineage events, instead of using
the OpenLineage provider's own public API for that. This replaces
both with calls to the provider's `emit_query_lineage` API.

This also fixes a bug where the START and COMPLETE events for a query
shared a single mutable Run/Job object, letting a facet added while
emitting one event leak into, or get corrupted alongside, the other.

* Fix expected-events fixture for the SQL hook-lineage job rename

The hook-lineage query sub-job name changed from "...query.N" to
"...hll_query.N" to avoid colliding with the "...query.N" naming used
by the Snowflake/Databricks query-lineage emitters added in this PR.
The policy/hook-lineage e2e fixture still expected the old name.

* Bump openlineage version in pyproject.toml

* pre commit

# Conflicts:
#	uv.lock

* address review comments

(cherry picked from commit 22f86cb)

Co-authored-by: Kacper Muda <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants