Add SnowflakeCortexAgentOperator to Snowflake Provider#69939
Open
SameerMesiah97 wants to merge 1 commit into
Open
Add SnowflakeCortexAgentOperator to Snowflake Provider#69939SameerMesiah97 wants to merge 1 commit into
SameerMesiah97 wants to merge 1 commit into
Conversation
Contributor
Author
|
This depends on PR #69731 being merged first. Please do not review this until that happens. |
SameerMesiah97
force-pushed
the
SnowflakeCortexAgentOperator
branch
3 times, most recently
from
July 17, 2026 19:10
77fc8f0 to
e052ae4
Compare
SameerMesiah97
marked this pull request as ready for review
July 17, 2026 20:15
SameerMesiah97
marked this pull request as draft
July 18, 2026 09:04
…ents using SnowflakeCortexAgentHook. Add unit tests, documentation, and an example DAG demonstrating how to invoke a Cortex Agent from an Airflow DAG.
SameerMesiah97
force-pushed
the
SnowflakeCortexAgentOperator
branch
from
July 18, 2026 13:28
e052ae4 to
d42e7ef
Compare
SameerMesiah97
marked this pull request as ready for review
July 18, 2026 19:53
shahar1
reviewed
Jul 22, 2026
| from functools import cached_property | ||
| from typing import TYPE_CHECKING, Any | ||
|
|
||
| from airflow.models import BaseOperator |
Contributor
There was a problem hiding this comment.
Could you please use here the compatibility shim?
from airflow.providers.common.compat.sdk import BaseOperator
shahar1
reviewed
Jul 22, 2026
| ``snowflake_default``. | ||
| """ | ||
|
|
||
| template_fields: Sequence[str] = ("messages",) |
Contributor
There was a problem hiding this comment.
Please consider adding database/schema/agent_name to template_fields
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 change introduces a new
SnowflakeCortexAgentOperatorfor executing Snowflake Cortex Agents from Airflow DAGs.The operator delegates to the existing
SnowflakeCortexAgentHook, providing a declarative interface for invoking Cortex Agents with support for Airflow templating and XCom.Rationale
SnowflakeCortexAgentHookalready exposes the Snowflake Cortex Agent Run API, but users currently need to invoke it from custom Python tasks. This operator promotes that functionality to a first-class Airflow task, making Cortex Agent execution consistent with other operators in the Snowflake provider and enabling it to be composed naturally within DAGs.Tests
Added unit tests verifying that:
SnowflakeCortexAgentOperatorcorrectly delegates execution toSnowflakeCortexAgentHook.run_agent.Example DAG
Added a new example DAG,
example_snowflake_cortex_agent, demonstrating how to execute a Snowflake Cortex Agent usingSnowflakeCortexAgentOperator.Documentation
Added documentation for
SnowflakeCortexAgentOperator, including its supported parameters and a usage example.Backwards Compatibility
This is a new operator and does not modify existing functionality. No breaking changes are introduced.