cruseakshay commented on code in PR #60650:
URL: https://github.com/apache/airflow/pull/60650#discussion_r2705647418


##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/triggers/data_factory.py:
##########
@@ -164,70 +165,73 @@ async def run(self) -> AsyncIterator[TriggerEvent]:
         """Make async connection to Azure Data Factory, polls for the pipeline 
run status."""
         hook = 
AzureDataFactoryAsyncHook(azure_data_factory_conn_id=self.azure_data_factory_conn_id)
         try:
-            pipeline_status = await hook.get_adf_pipeline_run_status(
-                run_id=self.run_id,
-                resource_group_name=self.resource_group_name,
-                factory_name=self.factory_name,
-            )
-            executed_after_token_refresh = True
-            if self.wait_for_termination:
-                while self.end_time > time.time():
-                    try:
-                        pipeline_status = await 
hook.get_adf_pipeline_run_status(
-                            run_id=self.run_id,
-                            resource_group_name=self.resource_group_name,
-                            factory_name=self.factory_name,
-                        )
-                        executed_after_token_refresh = True
-                        if pipeline_status in 
AzureDataFactoryPipelineRunStatus.FAILURE_STATES:
-                            yield TriggerEvent(
-                                {
-                                    "status": "error",
-                                    "message": f"The pipeline run 
{self.run_id} has {pipeline_status}.",
-                                    "run_id": self.run_id,
-                                }
+            async with hook:

Review Comment:
   Done



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to