Skip to content

Snowflake, Databricks: emit query lineage via OpenLineage public API - #73655

Merged
mobuchowski merged 5 commits into
apache:mainfrom
kacpermuda:kacpermuda/o11y-3149-fix-snowflake-and-databricks-ol-query-extraction-in-airflow
Oct 14, 2026
Merged

mobuchowski merged 5 commits into
apache:mainfrom
kacpermuda:kacpermuda/o11y-3149-fix-snowflake-and-databricks-ol-query-extraction-in-airflow

Conversation

@kacpermuda

Copy link
Copy Markdown
Collaborator

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 it. 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.


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code

Generated-by: Claude Code following the guidelines

@kacpermuda
kacpermuda marked this pull request as ready for review September 24, 2026 11:18
@kacpermuda
kacpermuda force-pushed the kacpermuda/o11y-3149-fix-snowflake-and-databricks-ol-query-extraction-in-airflow branch from d453143 to a9ca6f4 Compare September 24, 2026 13:31
@kacpermuda
kacpermuda force-pushed the kacpermuda/o11y-3149-fix-snowflake-and-databricks-ol-query-extraction-in-airflow branch from a9ca6f4 to 774b48c Compare October 13, 2026 09:08
@kacpermuda
kacpermuda force-pushed the kacpermuda/o11y-3149-fix-snowflake-and-databricks-ol-query-extraction-in-airflow branch from 774b48c to f9f12d1 Compare October 13, 2026 09:24
@kacpermuda
kacpermuda force-pushed the kacpermuda/o11y-3149-fix-snowflake-and-databricks-ol-query-extraction-in-airflow branch from f9f12d1 to 6c16eee Compare October 13, 2026 12:11
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

uv.lock on main just moved via commit 68a4c31 and this PR currently conflicts.

Quickest fix:

git fetch upstream main && git rebase upstream/main
rm uv.lock && uv lock
git add uv.lock && git rebase --continue
git push --force-with-lease

Automated nudge — ignore if you're not ready to rebase. This comment is updated in place on future uv.lock bumps.

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.
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.
# Conflicts:
#	uv.lock
@kacpermuda
kacpermuda force-pushed the kacpermuda/o11y-3149-fix-snowflake-and-databricks-ol-query-extraction-in-airflow branch from 6c16eee to b5bc5de Compare October 14, 2026 09:23
@mobuchowski
mobuchowski merged commit 22f86cb into apache:main Oct 14, 2026
127 checks passed
@kacpermuda
kacpermuda deleted the kacpermuda/o11y-3149-fix-snowflake-and-databricks-ol-query-extraction-in-airflow branch October 14, 2026 15:26
potiuk pushed 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 <mudakacper@gmail.com>
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 <mudakacper@gmail.com>
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 <mudakacper@gmail.com>
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 <mudakacper@gmail.com>
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 <mudakacper@gmail.com>
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 <mudakacper@gmail.com>
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.

2 participants