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 b3678b3354e SnowflakeSqlApiOperator: add XCom query ID test coverage 
(#68731)
b3678b3354e is described below

commit b3678b3354e0d6c9d06069f5cde2be57d1cb9b01
Author: SameerMesiah97 <[email protected]>
AuthorDate: Wed Jul 1 22:13:03 2026 +0100

    SnowflakeSqlApiOperator: add XCom query ID test coverage (#68731)
---
 .../unit/snowflake/operators/test_snowflake.py     | 30 ++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git 
a/providers/snowflake/tests/unit/snowflake/operators/test_snowflake.py 
b/providers/snowflake/tests/unit/snowflake/operators/test_snowflake.py
index 1b459299dfd..cea968c38cd 100644
--- a/providers/snowflake/tests/unit/snowflake/operators/test_snowflake.py
+++ b/providers/snowflake/tests/unit/snowflake/operators/test_snowflake.py
@@ -389,6 +389,36 @@ class TestSnowflakeSqlApiOperator:
             "Trigger is not a SnowflakeSqlApiTrigger"
         )
 
+    def test_snowflake_sql_api_pushes_query_ids_to_xcom(
+        self,
+        mock_execute_query,
+        mock_get_sql_api_query_status,
+    ):
+        """
+        Tests that query IDs returned by the Snowflake SQL API are pushed to 
XCom
+        when ``do_xcom_push=True``.
+        """
+        operator = SnowflakeSqlApiOperator(
+            task_id=TASK_ID,
+            snowflake_conn_id=CONN_ID,
+            sql=SQL_MULTIPLE_STMTS,
+            statement_count=4,
+            do_xcom_push=True,
+            deferrable=False,
+        )
+
+        mock_execute_query.return_value = ["uuid1"]
+        mock_get_sql_api_query_status.return_value = {"status": "success"}
+
+        context = create_context(operator)
+
+        operator.execute(context)
+
+        context["ti"].xcom_push.assert_called_once_with(
+            key="query_ids",
+            value=["uuid1"],
+        )
+
     def test_snowflake_sql_api_execute_complete_failure(self):
         """Test SnowflakeSqlApiOperator raise RuntimeError of error event"""
 

Reply via email to