Repository navigation
Conversation
|
@kaxil This is similar to the conversation we just had about the other PRs. @SameerMesiah97 would like to chat about this. |
I would appreciate if you could provide more context here. Is there a blocking concern you wish for me to address? If you could link the existing conversation (if public) so that I can better understand the situation, that would be great. |
Hey @SameerMesiah97 , Sorry, I was not being deliberately cryptic :) I had seen a couple of very similar PRs to this from you (for Cortex) for other frameworks such as Google Vertex AI, etc. I was verbally chatting with @kaxil about making the interfaces consistent across these, so that DAG authors don't have to learn multiple invocation mechanisms. Hopefully, that clarifies? |
Okay. I understand completely. |
|
hey @SameerMesiah97 can you align to this interaface #71946 cc: @vikramkoka |
Sure. But keep in mind that this is dependent on PR #70101 and PR #70703 being merged first. |
aa03aec to
1309e45
Compare
|
@SameerMesiah97 Could you post some screenshot of Airflow UI and Snowflake UI on how this all works e2e |
e66d811 to
2eb5fc6
Compare
I have ran the following DAG that uses all 4 Cortex Agent operators: All tasks executed sucessfully:
Because the DAG deletes the agent, we cannot see the actual thread in the Snowflake UI that is created when the agent is prompted after the DAG finishes execution. However, the return values (which are returned by the API) are pushed to XCom and we can see them in the Airflow UI. For example, this is what I see when for the
This is what I see for the
And this is what I see when for
Keep in mind that update agent endpoint does not return a non-empty payload. But after running a modified version of the above DAG (with only the
|
|
CI failure appears unrelated. |
cc85b50 to
4a47661
Compare
Add create, update and delete operators backed by existing hook methods. Include unit tests for hook delegation and template fields, and expand the example DAG and documentation with management operator usage.
Validate create modes during DAG parsing and document accepted values. Use autospecced hook mocks to verify operator defaults and signatures. Make system-test agents unique, guarantee teardown, and reorganize the operator documentation.
Parametrize operator tests to cover defaults and all optional arguments. Document that unset update fields retain their existing Snowflake values.
4a47661 to
f53b2be
Compare





Description
This change adds management operators for Snowflake Cortex Agents.
The Snowflake provider now includes operators to create, update and delete Cortex Agents, complementing the existing
SnowflakeCortexAgentOperatorused to execute them. Each operator is a thin wrapper around the corresponding hook method and follows the existing provider patterns.Rationale
The existing hook already exposes the Snowflake Cortex Agent management APIs. Providing corresponding operators allows these operations to be used directly in DAGs without requiring users to invoke the hook from custom Python tasks.
This completes the operator support for the Cortex Agent lifecycle while remaining consistent with the abstractions provided throughout the Snowflake provider.
Tests
Added unit tests verifying that:
SnowflakeCortexAgentCreateOperatordelegates tocreate_agent()with the expected arguments.SnowflakeCortexAgentUpdateOperatordelegates toupdate_agent()with the expected arguments.SnowflakeCortexAgentDeleteOperatordelegates todelete_agent()with the expected arguments.Notes
Kindly note that
SnowflakeCortexAgentHookwill be aligned withBaseManagedAgentHookintroduced in PR #73532 in a follow-up PR.Documentation
The example DAG and operator documentation have also been expanded to include usage examples for each management operator.
Backwards Compatibility
This change is fully backwards compatible. The existing
SnowflakeCortexAgentOperatoris unchanged. The new management operators are additive and do not modify the behaviour of existing hooks or operators.Was generative AI tooling used to co-author this PR?
Generated-by: [GPT 5.5] following the guidelines