amoghrajesh commented on code in PR #77162:
URL: https://github.com/apache/airflow/pull/77162#discussion_r4595816817
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/data_factory.py:
##########
@@ -181,11 +199,28 @@ def execute(self, context: Context) -> None:
start_from_failure=self.start_from_failure,
parameters=self.parameters,
)
- self.run_id = response.run_id
- # Push the ``run_id`` value to XCom regardless of what happens during
execution. This allows for
- # retrieval the executed pipeline's ``run_id`` for downstream tasks
especially if performing an
- # asynchronous wait.
- context["ti"].xcom_push(key="run_id", value=self.run_id)
+ self._record_run_id(response.run_id, context)
+ return response.run_id
+
+ def get_job_status(self, external_id: JsonValue, context: Context) -> str:
+ try:
+ return self.hook.get_pipeline_run_status(
+ str(external_id), self.resource_group_name, self.factory_name
+ )
+ except ResourceNotFoundError:
+ return "NotFound"
+
+ def is_job_active(self, status: str) -> bool:
+ return self.wait_for_termination and status in
AzureDataFactoryPipelineRunStatus.INTERMEDIATE_STATES
+
+ def is_job_succeeded(self, status: str) -> bool:
+ # Without wait_for_termination a retry does not wait for a run in
progress either.
+ return status == AzureDataFactoryPipelineRunStatus.SUCCEEDED or (
+ not self.wait_for_termination and status in
AzureDataFactoryPipelineRunStatus.INTERMEDIATE_STATES
Review Comment:
Applied.
--
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]