amoghrajesh commented on code in PR #76036:
URL: https://github.com/apache/airflow/pull/76036#discussion_r4440339673


##########
providers/amazon/src/airflow/providers/amazon/aws/operators/sagemaker.py:
##########
@@ -1274,89 +1283,133 @@ def _create_integer_fields(self) -> None:
     def execute(self, context: Context) -> dict:
         self.preprocess_config()
 
+        if self.deferrable and not self.wait_for_completion:
+            self.log.warning(
+                "Setting deferrable to True does not have effect when 
wait_for_completion is set to False."
+            )
+
+        if self.deferrable and self.wait_for_completion:
+            return self._execute_deferrable(context)
+
+        return self.execute_resumable(context)

Review Comment:
   `poll_until_complete` now records the serialized result and `execute()` 
reads it back, so a reconnect returns `{"Training": ...}` and sets 
`serialized_training_data`. `get_job_result` only describes when the result was 
not already captured, so the fresh path still makes one call. 
`test_durable_reconnects_to_a_running_job` asserts the return value, and it 
fails if the capture is removed. Left the mixin alone since changing its 
reconnect semantics would affect Glue, Databricks, PowerBI and Snowflake.



-- 
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