This is an automated email from the ASF dual-hosted git repository.

joshfell 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 0e69ca7c0f Fix ADF job failure during deferral (#30248)
0e69ca7c0f is described below

commit 0e69ca7c0f87045264a82c2b2daa953506579d5f
Author: Phani Kumar <[email protected]>
AuthorDate: Wed Mar 29 20:16:55 2023 +0530

    Fix ADF job failure during deferral (#30248)
    
    * Fix job failure during deferral
    
    * Move async conn outside context manager
---
 airflow/providers/microsoft/azure/hooks/data_factory.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/airflow/providers/microsoft/azure/hooks/data_factory.py 
b/airflow/providers/microsoft/azure/hooks/data_factory.py
index 836983b69c..7022354395 100644
--- a/airflow/providers/microsoft/azure/hooks/data_factory.py
+++ b/airflow/providers/microsoft/azure/hooks/data_factory.py
@@ -1148,12 +1148,12 @@ class AzureDataFactoryAsyncHook(AzureDataFactoryHook):
         :param factory_name: The factory name.
         :param config: Extra parameters for the ADF client.
         """
-        async with await self.get_async_conn() as client:
-            try:
-                pipeline_run = await 
client.pipeline_runs.get(resource_group_name, factory_name, run_id)
-                return pipeline_run
-            except Exception as e:
-                raise AirflowException(e)
+        client = await self.get_async_conn()
+        try:
+            pipeline_run = await client.pipeline_runs.get(resource_group_name, 
factory_name, run_id)
+            return pipeline_run
+        except Exception as e:
+            raise AirflowException(e)
 
     async def get_adf_pipeline_run_status(
         self, run_id: str, resource_group_name: str | None = None, 
factory_name: str | None = None

Reply via email to