This is an automated email from the ASF dual-hosted git repository.
shahar1 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 9ba24e89769 Add JSON template renderers to Snowflake Cortex Agent
operators (#77422)
9ba24e89769 is described below
commit 9ba24e8976905926e5a4774388ac9500c5b9c59a
Author: SameerMesiah97 <[email protected]>
AuthorDate: Mon Nov 23 16:27:37 2026 +0000
Add JSON template renderers to Snowflake Cortex Agent operators (#77422)
Configure JSON rendering for structured template fields in the
Cortex Agent Create and Update operators.
Improve readability of rendered configuration in the Airflow UI
and add regression tests for both operators.
Co-authored-by: Sameer Mesiah <[email protected]>
---
.../providers/snowflake/operators/cortex_agent.py | 18 ++++++++++++++++
.../unit/snowflake/operators/test_cortex_agent.py | 25 ++++++++++++++++++++++
2 files changed, 43 insertions(+)
diff --git
a/providers/snowflake/src/airflow/providers/snowflake/operators/cortex_agent.py
b/providers/snowflake/src/airflow/providers/snowflake/operators/cortex_agent.py
index 22db75f16dc..8e3f4e17fdf 100644
---
a/providers/snowflake/src/airflow/providers/snowflake/operators/cortex_agent.py
+++
b/providers/snowflake/src/airflow/providers/snowflake/operators/cortex_agent.py
@@ -178,6 +178,15 @@ class SnowflakeCortexAgentCreateOperator(BaseOperator):
"snowflake_conn_id",
)
+ template_fields_renderers = {
+ "profile": "json",
+ "models": "json",
+ "instructions": "json",
+ "orchestration": "json",
+ "tools": "json",
+ "tool_resources": "json",
+ }
+
ui_color = "#29B5E8"
def __init__(
@@ -283,6 +292,15 @@ class SnowflakeCortexAgentUpdateOperator(BaseOperator):
"snowflake_conn_id",
)
+ template_fields_renderers = {
+ "profile": "json",
+ "models": "json",
+ "instructions": "json",
+ "orchestration": "json",
+ "tools": "json",
+ "tool_resources": "json",
+ }
+
ui_color = "#29B5E8"
def __init__(
diff --git
a/providers/snowflake/tests/unit/snowflake/operators/test_cortex_agent.py
b/providers/snowflake/tests/unit/snowflake/operators/test_cortex_agent.py
index 6ae55a1d7fd..714e9d17523 100644
--- a/providers/snowflake/tests/unit/snowflake/operators/test_cortex_agent.py
+++ b/providers/snowflake/tests/unit/snowflake/operators/test_cortex_agent.py
@@ -270,6 +270,31 @@ class TestSnowflakeCortexAgentUpdateOperator:
assert result == response
[email protected](
+ "operator_class",
+ [
+ SnowflakeCortexAgentCreateOperator,
+ SnowflakeCortexAgentUpdateOperator,
+ ],
+)
+def test_configuration_template_renderers(operator_class):
+ operator = operator_class(
+ task_id=TASK_ID,
+ database="MY_DATABASE",
+ schema="MY_SCHEMA",
+ agent_name="my_agent",
+ )
+
+ assert operator.template_fields_renderers == {
+ "profile": "json",
+ "models": "json",
+ "instructions": "json",
+ "orchestration": "json",
+ "tools": "json",
+ "tool_resources": "json",
+ }
+
+
class TestSnowflakeCortexAgentDeleteOperator:
@pytest.mark.parametrize(
("operator_kwargs", "expected_kwargs"),