SameerMesiah97 commented on code in PR #71653:
URL: https://github.com/apache/airflow/pull/71653#discussion_r3833448019
##########
providers/amazon/src/airflow/providers/amazon/aws/triggers/sagemaker.py:
##########
@@ -108,6 +108,90 @@ def hook(self) -> AwsGenericHook:
config=self.botocore_config,
)
+ async def run(self) -> AsyncIterator[TriggerEvent]:
+ hook = self.hook()
+
+ async with await hook.get_async_conn() as conn:
+ waiter = hook.get_waiter(
+ self.waiter_name,
+ deferrable=True,
+ client=conn,
+ )
+
+ for _ in range(self.attempts):
+ try:
+ await waiter.wait(
+ **self.waiter_args,
+ WaiterConfig={"MaxAttempts": 1},
+ )
+ except WaiterError as error:
+ response = error.last_response
+ status =
response.get(self._get_response_status_key(self.job_type))
Review Comment:
The below has now been added:
```
if status is None:
yield TriggerEvent(
{
"status": "error",
"message": str(error),
"job_name": self.job_name,
}
)
return
```
--
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]