You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "manipatnam (via GitHub)" <gi...@apache.org> on 2025/09/17 03:01:37 UTC
[I] Deferred SnowflakeSqlApiOperator + Airflow 3.0.3 failure [airflow]
manipatnam opened a new issue, #55747:
URL: https://github.com/apache/airflow/issues/55747
### Apache Airflow Provider(s)
snowflake
### Versions of Apache Airflow Providers
apache-airflow-providers-snowflake==6.4.0
### Apache Airflow version
Airflow 3.0.3
### Operating System
Linux
### Deployment
Astronomer
### Deployment details
_No response_
### What happened
Running the SnowflakeSqlApiOperator async + Airflow 3.0.6 gives this failure:
```Task failed with exception: source="task"
AirflowException: error: You cannot use AsyncToSync in the same thread as an async event loop - just await the async function directly.
File "/usr/local/lib/python3.12/site-packages/airflow/sdk/execution_time/task_runner.py", line 920 in run
File "/usr/local/lib/python3.12/site-packages/airflow/sdk/execution_time/task_runner.py", line 1215 in _execute_task
File "/usr/local/lib/python3.12/site-packages/airflow/sdk/bases/operator.py", line 1606 in resume_execution
File "/usr/local/lib/python3.12/site-packages/airflow/providers/snowflake/operators/snowflake.py", line 510 in execute_complete```
The operator runs fine on Airflow 2.
### What you think should happen instead
The operator should not fail
### How to reproduce
Run SnowflakeSqlApiOperator async + Airflow 3.0.6
Sample code
```
import pendulum
from airflow.decorators import dag
from airflow.providers.snowflake.operators.snowflake import (
SnowflakeSqlApiOperator,
)
@dag(
dag_id="test_dbt_multi_repo_v1",
default_args={
"owner": "data-engineering",
"depends_on_past": False,
"retries": 0,
},
start_date=pendulum.today("UTC").add(days=-1),
schedule=None,
max_active_runs=1,
tags=["data-engineering", "test"],
)
def create_dag():
snow = SnowflakeSqlApiOperator(
deferrable=True,
task_id="snow",
snowflake_conn_id="snowflake_test",
poll_interval=60,
sql="SELECT * from snowflake_sample_data.tpcds_sf100tcl.call_center",
# sql="select * from HG_ANALYTICS_PROD.OPEN.V_GA4_ALL where event_date >'20250101'",
)
(
snow
)
dag = create_dag()
```
### Anything else
_No response_
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Deferred SnowflakeSqlApiOperator + Airflow 3.0.3 failure [airflow]
Posted by "yash1thsa (via GitHub)" <gi...@apache.org>.
yash1thsa commented on issue #55747:
URL: https://github.com/apache/airflow/issues/55747#issuecomment-3325222226
@rawwar if it is still open, i can help
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Deferred SnowflakeSqlApiOperator + Airflow 3.0.3 failure [airflow]
Posted by "Ferdinanddb (via GitHub)" <gi...@apache.org>.
Ferdinanddb commented on issue #55747:
URL: https://github.com/apache/airflow/issues/55747#issuecomment-3335613676
For info I have the same problem with the [`SparkKubernetesOperator` from `cncf.kubernetes` provider.](https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/stable/operators.html#sparkkubernetesoperator). Since I migrated to Airflow 3.x.x, I was not able to run any task in the deferrable mode, and everything was working fine on Airflow 2.11 / 2.10.
I suspect that something is off in the way the triggerer is behaving, because my task (Spark job in my case) is succeeding, but the Airflow task fails with the following log (similar to the one mentioned in this issue, hence my comment):
```
AttributeError: 'SparkKubernetesOperator' object has no attribute 'launcher'
File "/home/airflow/.local/lib/python3.12/site-packages/airflow/sdk/execution_time/task_runner.py", line 920 in run
File "/home/airflow/.local/lib/python3.12/site-packages/airflow/sdk/execution_time/task_runner.py", line 1215 in _execute_task
File "/home/airflow/.local/lib/python3.12/site-packages/airflow/sdk/bases/operator.py", line 1606 in resume_execution
File "/home/airflow/.local/lib/python3.12/site-packages/airflow/providers/cncf/kubernetes/operators/pod.py", line 956 in trigger_reentry
File "/home/airflow/.local/lib/python3.12/site-packages/airflow/providers/cncf/kubernetes/operators/pod.py", line 978 in _clean
File "/home/airflow/.local/lib/python3.12/site-packages/airflow/providers/cncf/kubernetes/operators/pod.py", line 1013 in post_complete_action
File "/home/airflow/.local/lib/python3.12/site-packages/airflow/providers/cncf/kubernetes/operators/pod.py", line 1056 in cleanup
File "/home/airflow/.local/lib/python3.12/site-packages/airflow/providers/cncf/kubernetes/operators/spark_kubernetes.py", line 265 in process_pod_deletion
AirflowException: Traceback (most recent call last):
File "/home/airflow/.local/lib/python3.12/site-packages/airflow/providers/cncf/kubernetes/triggers/pod.py", line 148, in run
state = await self._wait_for_pod_start()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/airflow/.local/lib/python3.12/site-packages/airflow/providers/cncf/kubernetes/triggers/pod.py", line 213, in _wait_for_pod_start
pod = await self._get_pod()
^^^^^^^^^^^^^^^^^^^^^
File "/home/airflow/.local/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 189, in async_wrapped
return await copy(fn, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/airflow/.local/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 111, in __call__
do = await self.iter(retry_state=retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/airflow/.local/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 153, in iter
result = await action(retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/airflow/.local/lib/python3.12/site-packages/tenacity/_utils.py", line 99, in inner
return call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/home/airflow/.local/lib/python3.12/site-packages/tenacity/__init__.py", line 420, in exc_check
raise retry_exc.reraise()
^^^^^^^^^^^^^^^^^^^
File "/home/airflow/.local/lib/python3.12/site-packages/tenacity/__init__.py", line 187, in reraise
raise self.last_attempt.result()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/home/airflow/.local/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 114, in __call__
result = await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/airflow/.local/lib/python3.12/site-packages/airflow/providers/cncf/kubernetes/triggers/pod.py", line 276, in _get_pod
pod = await self.hook.get_pod(name=self.pod_name, namespace=self.pod_namespace)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/airflow/.local/lib/python3.12/site-packages/airflow/providers/cncf/kubernetes/hooks/kubernetes.py", line 851, in get_pod
async with self.get_conn() as connection:
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/contextlib.py", line 210, in __aenter__
return await anext(self.gen)
^^^^^^^^^^^^^^^^^^^^^
File "/home/airflow/.local/lib/python3.12/site-packages/airflow/providers/cncf/kubernetes/hooks/kubernetes.py", line 838, in get_conn
kube_client = await self._load_config() or async_client.ApiClient()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/airflow/.local/lib/python3.12/site-packages/airflow/providers/cncf/kubernetes/hooks/kubernetes.py", line 757, in _load_config
in_cluster = self._coalesce_param(self.in_cluster, await self._get_field("in_cluster"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/airflow/.local/lib/python3.12/site-packages/airflow/providers/cncf/kubernetes/hooks/kubernetes.py", line 828, in _get_field
extras = await self.get_conn_extras()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/airflow/.local/lib/python3.12/site-packages/airflow/providers/cncf/kubernetes/hooks/kubernetes.py", line 817, in get_conn_extras
self._extras = connection.extra_dejson
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/airflow/.local/lib/python3.12/site-packages/airflow/models/connection.py", line 449, in extra_dejson
return self.get_extra_dejson()
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/airflow/.local/lib/python3.12/site-packages/airflow/models/connection.py", line 442, in get_extra_dejson
mask_secret(extra)
File "/home/airflow/.local/lib/python3.12/site-packages/airflow/sdk/execution_time/secrets_masker.py", line 134, in mask_secret
comms.send(MaskSecret(value=secret, name=name))
File "/home/airflow/.local/lib/python3.12/site-packages/airflow/jobs/triggerer_job_runner.py", line 740, in send
return async_to_sync(self.asend)(msg)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/airflow/.local/lib/python3.12/site-packages/asgiref/sync.py", line 186, in __call__
raise RuntimeError(
RuntimeError: You cannot use AsyncToSync in the same thread as an async event loop - just await the async function directly.
```
Hope that helps!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Deferred SnowflakeSqlApiOperator + Airflow 3.0.3 failure [airflow]
Posted by "yash1thsa (via GitHub)" <gi...@apache.org>.
yash1thsa commented on issue #55747:
URL: https://github.com/apache/airflow/issues/55747#issuecomment-3347193914
hi remus, i have replicated the issue in my system . Currently debugging the issue. Will have some update in couple of days
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Deferred SnowflakeSqlApiOperator + Airflow 3.0.3 failure [airflow]
Posted by "remus-smg (via GitHub)" <gi...@apache.org>.
remus-smg commented on issue #55747:
URL: https://github.com/apache/airflow/issues/55747#issuecomment-3424672021
@yash1thsa @rawwar , any updates on this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Deferred SnowflakeSqlApiOperator + Airflow 3.0.3 failure [airflow]
Posted by "remus-smg (via GitHub)" <gi...@apache.org>.
remus-smg commented on issue #55747:
URL: https://github.com/apache/airflow/issues/55747#issuecomment-3506829814
Checked with Airflow 3.1.2 (running with Astro Runtime 3.1-4) and it works.
Thanks a lot!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Deferred SnowflakeSqlApiOperator + Airflow 3.0.3 failure [airflow]
Posted by "phanikumv (via GitHub)" <gi...@apache.org>.
phanikumv commented on issue #55747:
URL: https://github.com/apache/airflow/issues/55747#issuecomment-3328232594
Assigned you @yash1thsa
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Deferred SnowflakeSqlApiOperator + Airflow 3.0.3 failure [airflow]
Posted by "yash1thsa (via GitHub)" <gi...@apache.org>.
yash1thsa commented on issue #55747:
URL: https://github.com/apache/airflow/issues/55747#issuecomment-3362522863
@rawwar / @Ferdinanddb - I was able to debug this issue.
Root cause : Synchronous calls triggered underneath async functions. Main issue is in Triggerer code that calls the hook. Triggerer is async by default. But when it hits the hook, the error happens during the initialization itself.
Alternatives tried:
1. Create a asynchronous path in trigerrer - get_request_url_header_params, get_connection, get_header etc. But this still did not stop the async to sync issue.
2. Decouple hook from trigger. Handle the hook completely in operator class itself. And send only the connection parameters to trigger. This solves the deadlock . Here is a working code (just for reference not a fix) - [](https://github.com/apache/airflow/compare/main...yash1thsa:airflow:snowflake_async_rc?expand=1 )
Next steps:
- Need guidance on the direction . If its ok, need some help on clean refactoring
Successful log -
`[2025-10-02, 13:31:36] INFO - Generating a new token because the present time (2025-10-02 18:31:36.062698+00:00) is later than the renewal time (2025-10-02 18:31:36.062689+00:00): source="airflow.providers.snowflake.utils.sql_api_generate_jwt"
[2025-10-02, 13:31:36] INFO - Snowflake SQL GET statements status API response: {'code': '333334', 'message': 'Asynchronous execution in progress. Use provided query id to perform query monitoring and management.', 'statementHandle': '01bf7237-0003-9836-0009-c8660002606a', 'statementStatusUrl': '/api/v2/statements/01bf7237-0003-9836-0009-c8660002606a'}: source="airflow.providers.snowflake.hooks.snowflake_sql_api.SnowflakeSqlApiHook"
[2025-10-02, 13:31:36] INFO - Deferring task using CustomSnowflakeSqlApiTrigger to avoid AsyncToSync error.: source="airflow.task.operators.airflow.providers.snowflake.operators.snowflake.SnowflakeSqlApiOperator"
[2025-10-02, 13:31:36] INFO - Connection Retrieved 'snowflake_test': source="airflow.hooks.base"
[2025-10-02, 13:31:36] INFO - DEBUG: Using synchronous JWT path for headers.: source="airflow.providers.snowflake.hooks.snowflake_sql_api.SnowflakeSqlApiHook"
[2025-10-02, 13:31:36] INFO - Creating JWTGenerator with arguments
account : iqnwtlc-zp51632, user : AIRFLOW_USER, lifetime : 0:59:00, renewal_delay : 0:54:00: source="airflow.providers.snowflake.utils.sql_api_generate_jwt"
[2025-10-02, 13:31:36] INFO - Generating a new token because the present time (2025-10-02 18:31:36.539343+00:00) is later than the renewal time (2025-10-02 18:31:36.539338+00:00): source="airflow.providers.snowflake.utils.sql_api_generate_jwt"
[2025-10-02, 13:31:36] INFO - Successfully retrieved Authorization header using hook.get_headers().: source="airflow.task.operators.airflow.providers.snowflake.operators.snowflake.SnowflakeSqlApiOperator"
[2025-10-02, 13:31:36] INFO - Pausing task as DEFERRED. : dag_id="test_snowflake_dag": task_id="snow": run_id="manual__2025-10-02T18:31:31.969628+00:00": source="task"
[2025-10-02, 13:31:37] INFO - trigger test_snowflake_dag/manual__2025-10-02T18:31:31.969628+00:00/snow/-1/1 (ID 51) starting
[2025-10-02, 13:31:37] INFO - Checking status for query ID 01bf7237-0003-9836-0009-c8660002606a at https://iqnwtlc-zp51632.snowflakecomputing.com/api/v2/statements/01bf7237-0003-9836-0009-c8660002606a: source="airflow.providers.snowflake.triggers.snowflake_trigger.CustomSnowflakeSqlApiTrigger"
[2025-10-02, 13:31:38] INFO - Snowflake SQL GET statements status API response: {'code': '333334', 'message': 'Asynchronous execution in progress. Use provided query id to perform query monitoring and management.', 'statementHandle': '01bf7237-0003-9836-0009-c8660002606a', 'statementStatusUrl': '/api/v2/statements/01bf7237-0003-9836-0009-c8660002606a'}: source="airflow.providers.snowflake.triggers.snowflake_trigger.CustomSnowflakeSqlApiTrigger"
[2025-10-02, 13:31:43] INFO - Checking status for query ID 01bf7237-0003-9836-0009-c8660002606a at https://iqnwtlc-zp51632.snowflakecomputing.com/api/v2/statements/01bf7237-0003-9836-0009-c8660002606a: source="airflow.providers.snowflake.triggers.snowflake_trigger.CustomSnowflakeSqlApiTrigger"
[2025-10-02, 13:31:43] INFO - Snowflake SQL GET statements status API response: {'code': '333334', 'message': 'Asynchronous execution in progress. Use provided query id to perform query monitoring and management.', 'statementHandle': '01bf7237-0003-9836-0009-c8660002606a', 'statementStatusUrl': '/api/v2/statements/01bf7237-0003-9836-0009-c8660002606a'}: source="airflow.providers.snowflake.triggers.snowflake_trigger.CustomSnowflakeSqlApiTrigger"
[2025-10-02, 13:31:48] INFO - Checking status for query ID 01bf7237-0003-9836-0009-c8660002606a at https://iqnwtlc-zp51632.snowflakecomputing.com/api/v2/statements/01bf7237-0003-9836-0009-c8660002606a: source="airflow.providers.snowflake.triggers.snowflake_trigger.CustomSnowflakeSqlApiTrigger"
[2025-10-02, 13:31:48] INFO - Snowflake SQL GET statements status API response: {'code': '333334', 'message': 'Asynchronous execution in progress. Use provided query id to perform query monitoring and management.', 'statementHandle': '01bf7237-0003-9836-0009-c8660002606a', 'statementStatusUrl': '/api/v2/statements/01bf7237-0003-9836-0009-c8660002606a'}: source="airflow.providers.snowflake.triggers.snowflake_trigger.CustomSnowflakeSqlApiTrigger"
[2025-10-02, 13:31:53] INFO - Checking status for query ID 01bf7237-0003-9836-0009-c8660002606a at https://iqnwtlc-zp51632.snowflakecomputing.com/api/v2/statements/01bf7237-0003-9836-0009-c8660002606a: source="airflow.providers.snowflake.triggers.snowflake_trigger.CustomSnowflakeSqlApiTrigger"
[2025-10-02, 13:31:54] INFO - Snowflake SQL GET statements status API response: {'code': '333334', 'message': 'Asynchronous execution in progress. Use provided query id to perform query monitoring and management.', 'statementHandle': '01bf7237-0003-9836-0009-c8660002606a', 'statementStatusUrl': '/api/v2/statements/01bf7237-0003-9836-0009-c8660002606a'}: source="airflow.providers.snowflake.triggers.snowflake_trigger.CustomSnowflakeSqlApiTrigger"
[2025-10-02, 13:31:59] INFO - Checking status for query ID 01bf7237-0003-9836-0009-c8660002606a at https://iqnwtlc-zp51632.snowflakecomputing.com/api/v2/statements/01bf7237-0003-9836-0009-c8660002606a: source="airflow.providers.snowflake.triggers.snowflake_trigger.CustomSnowflakeSqlApiTrigger"
[2025-10-02, 13:31:59] INFO - Snowflake SQL GET statements status API response: {'code': '333334', 'message': 'Asynchronous execution in progress. Use provided query id to perform query monitoring and management.', 'statementHandle': '01bf7237-0003-9836-0009-c8660002606a', 'statementStatusUrl': '/api/v2/statements/01bf7237-0003-9836-0009-c8660002606a'}: source="airflow.providers.snowflake.triggers.snowflake_trigger.CustomSnowflakeSqlApiTrigger"
[2025-10-02, 13:32:04] INFO - Checking status for query ID 01bf7237-0003-9836-0009-c8660002606a at https://iqnwtlc-zp51632.snowflakecomputing.com/api/v2/statements/01bf7237-0003-9836-0009-c8660002606a: source="airflow.providers.snowflake.triggers.snowflake_trigger.CustomSnowflakeSqlApiTrigger"
[2025-10-02, 13:32:05] INFO - Snowflake SQL GET statements status API response: {'code': '333334', 'message': 'Asynchronous execution in progress. Use provided query id to perform query monitoring and management.', 'statementHandle': '01bf7237-0003-9836-0009-c8660002606a', 'statementStatusUrl': '/api/v2/statements/01bf7237-0003-9836-0009-c8660002606a'}: source="airflow.providers.snowflake.triggers.snowflake_trigger.CustomSnowflakeSqlApiTrigger"
[2025-10-02, 13:32:10] INFO - Checking status for query ID 01bf7237-0003-9836-0009-c8660002606a at https://iqnwtlc-zp51632.snowflakecomputing.com/api/v2/statements/01bf7237-0003-9836-0009-c8660002606a: source="airflow.providers.snowflake.triggers.snowflake_trigger.CustomSnowflakeSqlApiTrigger"
[2025-10-02, 13:32:10] INFO - Snowflake SQL GET statements status API response: {'code': '333334', 'message': 'Asynchronous execution in progress. Use provided query id to perform query monitoring and management.', 'statementHandle': '01bf7237-0003-9836-0009-c8660002606a', 'statementStatusUrl': '/api/v2/statements/01bf7237-0003-9836-0009-c8660002606a'}: source="airflow.providers.snowflake.triggers.snowflake_trigger.CustomSnowflakeSqlApiTrigger"
[2025-10-02, 13:32:15] INFO - Checking status for query ID 01bf7237-0003-9836-0009-c8660002606a at https://iqnwtlc-zp51632.snowflakecomputing.com/api/v2/statements/01bf7237-0003-9836-0009-c8660002606a: source="airflow.providers.snowflake.triggers.snowflake_tri`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Deferred SnowflakeSqlApiOperator + Airflow 3.0.3 failure [airflow]
Posted by "yash1thsa (via GitHub)" <gi...@apache.org>.
yash1thsa commented on issue #55747:
URL: https://github.com/apache/airflow/issues/55747#issuecomment-3354698586
@remus-smg , i ran the following airflow dag triggering snowflake, the job did not fail in deferrable mode. Am i missing anything
Version - airflow 3.0.3
airflow - apache-airflow-providers-snowflake 6.4.0
`import pendulum
from airflow.models.dag import dag
from airflow.providers.snowflake.operators.snowflake import (
SnowflakeSqlApiOperator,
)
@dag(
dag_id="test_snowflake_dag",
default_args={
"owner": "data-engineering",
"depends_on_past": False,
"retries": 0,
},
start_date=pendulum.today("UTC").add(days=-1),
schedule=None,
max_active_runs=1,
tags=["data-engineering", "test"],
)
def create_dag():
snow = SnowflakeSqlApiOperator(
deferrable=True,
task_id="snow",
snowflake_conn_id="snowflake_test",
poll_interval=60,
sql="SELECT * from AIRFLOW_DB.AIRFLOW_SCHEMA.AIRFLOW_SAMPLE_TABLE",
)
(
snow
)
dag = create_dag()
Log -
`2025-10-01T04:23:08.601682 | INFO
Event: DAG bundles loaded: dags-folder
Logger: airflow.dag_processing.bundles.manager.DagBundlesManager
2025-10-01T04:23:08.602512 | INFO
Event: Filling up the DagBag from /files/dags/test_snowflake_dag.py
Logger: airflow.models.dagbag.DagBag
2025-10-01T04:23:10.151702 | INFO
Event: Executing: SELECT * from AIRFLOW_DB.AIRFLOW_SCHEMA.AIRFLOW_SAMPLE_TABLE
Logger: airflow.task.operators.airflow.providers.snowflake.operators.snowflake.SnowflakeSqlApiOperator
2025-10-01T04:23:10.208071 | INFO
Event: Connection Retrieved 'snowflake_test'
Logger: airflow.hooks.base
2025-10-01T04:23:10.254262 | INFO
Event: Connection Retrieved 'snowflake_test'
Logger: airflow.hooks.base
2025-10-01T04:23:10.289601 | INFO
Event: Creating JWTGenerator with arguments:
account: iqnwtlc-zp51632, user: AIRFLOW_USER, lifetime: 0:59:00, renewal_delay: 0:54:00
Logger: airflow.providers.snowflake.utils.sql_api_generate_jwt
2025-10-01T04:23:10.289688 | INFO
Event: Generating a new token because the present time (2025-10-01 04:23:10.289654+00:00) is later than the renewal time (2025-10-01 04:23:10.289651+00:00)
Logger: airflow.providers.snowflake.utils.sql_api_generate_jwt
2025-10-01T04:23:10.776938 | INFO
Event: Snowflake SQL POST API response: {
code: '333334',
message: 'Asynchronous execution in progress. Use provided query id to perform query monitoring and management.',
statementHandle: '01bf6947-0003-975a-0009-c8660001a0ca',
statementStatusUrl: '/api/v2/statements/01bf6947-0003-975a-0009-c8660001a0ca'
}
Logger: airflow.task.hooks.airflow.providers.snowflake.hooks.snowflake_sql_api.SnowflakeSqlApiHook
2025-10-01T04:23:10.780927 | INFO
Event: List of query ids ['01bf6947-0003-975a-0009-c8660001a0ca']
Logger: airflow.task.operators.airflow.providers.snowflake.operators.snowflake.SnowflakeSqlApiOperator
2025-10-01T04:23:10.842328 | INFO
Event: Retrieving status for query id 01bf6947-0003-975a-0009-c8660001a0ca
Logger: airflow.task.operators.airflow.providers.snowflake.operators.snowflake.SnowflakeSqlApiOperator
2025-10-01T04:23:10.842464 | INFO
Event: Retrieving status for query id 01bf6947-0003-975a-0009-c8660001a0ca
Logger: airflow.task.hooks.airflow.providers.snowflake.hooks.snowflake_sql_api.SnowflakeSqlApiHook
2025-10-01T04:23:10.842572 | INFO
Event: Creating JWTGenerator with arguments:
account: iqnwtlc-zp51632, user: AIRFLOW_USER, lifetime: 0:59:00, renewal_delay: 0:54:00
Logger: airflow.providers.snowflake.utils.sql_api_generate_jwt
2025-10-01T04:23:10.842653 | INFO
Event: Generating a new token because the present time (2025-10-01 04:23:10.842612+00:00) is later than the renewal time (2025-10-01 04:23:10.842610+00:00)
Logger: airflow.providers.snowflake.utils.sql_api_generate_jwt
2025-10-01T04:23:11.104325 | INFO
Event: Snowflake SQL GET statements status API response: {
resultSetMetaData: { numRows: 1, format: 'jsonv2', partitionInfo: [{ rowCount: 1, uncompressedSize: 78 }], rowType: [...] },
data: [['1', 'First Test Record from Airflow Setup', '1759076954.323000000']],
code: '090001',
statementStatusUrl: '/api/v2/statements/01bf6947-0003-975a-0009-c8660001a0ca?requestId=17a3d458-bc6f-4000-9351-e2c6e00cc9b2',
message: 'Statement executed successfully.',
createdOn: 1759292590783
}
Logger: airflow.task.hooks.airflow.providers.snowflake.hooks.snowflake_sql_api.SnowflakeSqlApiHook
2025-10-01T04:23:11.107731 | INFO
Event: Snowflake completed successfully.
Logger: airflow.task.operators.airflow.providers.snowflake.operators.snowflake.SnowflakeSqlApiOperator`
`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Deferred SnowflakeSqlApiOperator + Airflow 3.0.3 failure [airflow]
Posted by "rawwar (via GitHub)" <gi...@apache.org>.
rawwar closed issue #55747: Deferred SnowflakeSqlApiOperator + Airflow 3.0.3 failure
URL: https://github.com/apache/airflow/issues/55747
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Deferred SnowflakeSqlApiOperator + Airflow 3.0.3 failure [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on issue #55747:
URL: https://github.com/apache/airflow/issues/55747#issuecomment-3487209068
Marked it as "pending-response" @manipatnam and @remus-smg -> can you please check it with 3.1.1 - or better - with 3.1.2rc2 or final when it is out?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Deferred SnowflakeSqlApiOperator + Airflow 3.0.3 failure [airflow]
Posted by "rawwar (via GitHub)" <gi...@apache.org>.
rawwar commented on issue #55747:
URL: https://github.com/apache/airflow/issues/55747#issuecomment-3301294006
re-added `needs-triage` so that we can check if this still happens on main. if it does, we can consider this as a bug.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Deferred SnowflakeSqlApiOperator + Airflow 3.0.3 failure [airflow]
Posted by "yash1thsa (via GitHub)" <gi...@apache.org>.
yash1thsa commented on issue #55747:
URL: https://github.com/apache/airflow/issues/55747#issuecomment-3354741927
NVM, I got the error now. I was able make the task go into deferred state. Will keep you posted.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Deferred SnowflakeSqlApiOperator + Airflow 3.0.3 failure [airflow]
Posted by "remus-smg (via GitHub)" <gi...@apache.org>.
remus-smg commented on issue #55747:
URL: https://github.com/apache/airflow/issues/55747#issuecomment-3345494866
Hi @yash1thsa,
I was wondering if you’ve already started looking into this issue, or if you might have an estimate for when work on it could be completed. No pressure — I just need this information to better plan my work.
In our case, we cannot move forward with upgrading to Airflow 3 until deferrable operators (like SnowflakeSqlApiOperator) work as expected, so any update on progress would be very helpful.
Thanks a lot! 🙏
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Deferred SnowflakeSqlApiOperator + Airflow 3.0.3 failure [airflow]
Posted by "ashb (via GitHub)" <gi...@apache.org>.
ashb commented on issue #55747:
URL: https://github.com/apache/airflow/issues/55747#issuecomment-3484761046
Kaxil's change https://github.com/apache/airflow/pull/57154 should have fixed the original error. @Ferdinanddb's stack trace is a different case I suspect.
Certainly worth trying with 3.1.1 to see if this is fixed now. There is a reasonable chance it is fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Deferred SnowflakeSqlApiOperator + Airflow 3.0.3 failure [airflow]
Posted by "vikramkoka (via GitHub)" <gi...@apache.org>.
vikramkoka commented on issue #55747:
URL: https://github.com/apache/airflow/issues/55747#issuecomment-3470422820
cc: @ashb
Ash, would your change (roughly in the 3.1 timeframe) have fixed this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Deferred SnowflakeSqlApiOperator + Airflow 3.0.3 failure [airflow]
Posted by "rawwar (via GitHub)" <gi...@apache.org>.
rawwar commented on issue #55747:
URL: https://github.com/apache/airflow/issues/55747#issuecomment-3301559645
was able to replicate this on Main
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org