Lee-W commented on code in PR #36685:
URL: https://github.com/apache/airflow/pull/36685#discussion_r1471055969


##########
airflow/providers/amazon/aws/operators/sagemaker.py:
##########
@@ -1085,8 +1089,50 @@ def execute(self, context: Context) -> dict:
             raise AirflowException(f"Sagemaker Training Job creation failed: 
{response}")
 
         if self.deferrable and self.wait_for_completion:
+            description = 
self.hook.describe_training_job(self.config["TrainingJobName"])
+            status = description["TrainingJobStatus"]
+
+            if self.print_log:
+                instance_count = description["ResourceConfig"]["InstanceCount"]
+                last_describe_job_call = time.monotonic()
+                job_already_completed = status not in 
self.hook.non_terminal_states
+                _, last_description, last_describe_job_call = 
self.hook.describe_training_job_with_log(
+                    self.config["TrainingJobName"],
+                    {},
+                    [],
+                    instance_count,
+                    LogState.TAILING if job_already_completed else 
LogState.COMPLETE,

Review Comment:
   Yes, i think the condition is correct. Is there any concern here?



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to