amoghrajesh commented on code in PR #76033:
URL: https://github.com/apache/airflow/pull/76033#discussion_r4440186897
##########
providers/amazon/src/airflow/providers/amazon/aws/operators/sagemaker.py:
##########
@@ -1371,6 +1379,12 @@ def serialize_result(self, job_name: str) -> dict[str,
dict]:
self.serialized_training_data =
serialize(self.hook.describe_training_job(job_name))
return {"Training": self.serialized_training_data}
+ def on_kill(self) -> None:
Review Comment:
Added `cancel_on_kill` to `SageMakerTrigger` with an `async on_kill` that
calls `stop_training_job`, following `EmrContainerTrigger`. It defaults to
`False`, and `SageMakerTrainingOperator` passes `stop_training_job_on_kill`
through when it defers. Since the trigger is shared, `on_kill` also returns
early unless `job_type` is `Training`, so a `Transform` or `Processing` trigger
with the flag set cannot issue a training job stop. Exceptions are logged and
swallowed rather than raised. The operator docstring now says the deferred path
needs Airflow 3.3 or later.
--
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]