You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/07/06 19:27:51 UTC

[GitHub] [airflow] shubham22 commented on a diff in pull request #23628: Fixes SageMaker operator return values

shubham22 commented on code in PR #23628:
URL: https://github.com/apache/airflow/pull/23628#discussion_r915184338


##########
airflow/providers/amazon/aws/operators/sagemaker.py:
##########
@@ -188,7 +193,7 @@ def execute(self, context: 'Context') -> dict:
         )
         if response['ResponseMetadata']['HTTPStatusCode'] != 200:
             raise AirflowException(f'Sagemaker Processing Job creation failed: {response}')
-        return {'Processing': self.hook.describe_processing_job(self.config['ProcessingJobName'])}
+        return {'Processing': serialize(self.hook.describe_processing_job(self.config['ProcessingJobName']))}

Review Comment:
   @uranusjr Dennis and I discussed this and we feel that in-place replace for Datetime might be more complex hack as compared to the current proposed solution which serializes the entire output while keeping the dictionary type. There multiple Datetimes returned - `describe_training_job` has 9, `describe_processing_job` has 4 and so no  - requiring recursion for an in-place replace. 
   
   Now the choice is between the currently proposed approach or using `AirflowJsonEncoder` in SageMaker operator only. I am still trying to understand how that would be a better approach than this. We'd appreciate your feedback on this as well.
   



-- 
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-unsubscribe@airflow.apache.org

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