Skip to content

feat: Add explicit support for SnowflakeSqlApiHook to Ol helper #52161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 30, 2025

Conversation

kacpermuda
Copy link
Contributor

@kacpermuda kacpermuda commented Jun 24, 2025

OpenLineage is using a helper method emit_openlineage_events_for_snowflake_queries to emit OL events for Snowflake queries. This PR adds support for SnowflakeSqlApiHook in this helper and also adjusts some args so it's easier for users to also use this helper function in their custom code.

The idea here is that users would be able to call this from within their python/custom operator and it will emit additonal OL events for each query_id with parentRunFacet pointing to the Airflow task, so the backend can still easily know about the parent/child relationship. This will allow users to easily deliver query_ids to the lineage backend even from within custom code.

emit_openlineage_events_for_snowflake_queries(task_instance=kwargs["ti"], query_ids=["1", "2"])

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@boring-cyborg boring-cyborg bot added area:providers provider:snowflake Issues related to Snowflake provider labels Jun 24, 2025
@kacpermuda kacpermuda force-pushed the nit-ol-snowflake-helper-update branch 4 times, most recently from 42d412d to de1444c Compare June 27, 2025 14:10
@kacpermuda kacpermuda marked this pull request as ready for review June 27, 2025 14:13
@kacpermuda
Copy link
Contributor Author

cc @mobuchowski

@potiuk potiuk force-pushed the nit-ol-snowflake-helper-update branch from de1444c to 2477a63 Compare June 28, 2025 19:01
@potiuk
Copy link
Member

potiuk commented Jun 28, 2025

rebasing to account for compat tests.

@mobuchowski mobuchowski merged commit 43d3fb5 into apache:main Jun 30, 2025
68 checks passed
@kacpermuda kacpermuda deleted the nit-ol-snowflake-helper-update branch June 30, 2025 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:providers provider:snowflake Issues related to Snowflake provider
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants