This is an automated email from the ASF dual-hosted git repository.
potiuk 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 3d01919a30 Avoid blocking event loop when using DataFusionAsyncHook by
replacing sleep by asyncio.sleep (#33756)
3d01919a30 is described below
commit 3d01919a30acd85eec40fdd81029ed94613d280f
Author: Hussein Awala <[email protected]>
AuthorDate: Sat Aug 26 09:15:50 2023 +0200
Avoid blocking event loop when using DataFusionAsyncHook by replacing sleep
by asyncio.sleep (#33756)
---
airflow/providers/google/cloud/hooks/datafusion.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/airflow/providers/google/cloud/hooks/datafusion.py
b/airflow/providers/google/cloud/hooks/datafusion.py
index 38b0660212..b0e44081c7 100644
--- a/airflow/providers/google/cloud/hooks/datafusion.py
+++ b/airflow/providers/google/cloud/hooks/datafusion.py
@@ -17,6 +17,7 @@
"""This module contains Google DataFusion hook."""
from __future__ import annotations
+import asyncio
import json
import os
from time import monotonic, sleep
@@ -528,7 +529,7 @@ class DataFusionAsyncHook(GoogleBaseAsyncHook):
break
except Exception as exc:
if "404" in str(exc):
- sleep(time_to_wait)
+ await asyncio.sleep(time_to_wait)
else:
raise
if pipeline: