Swalloow commented on a change in pull request #11612:
URL: https://github.com/apache/airflow/pull/11612#discussion_r507727768
##########
File path: airflow/providers/amazon/aws/sensors/sagemaker_training.py
##########
@@ -72,6 +75,15 @@ def get_sagemaker_response(self):
if self.print_log:
if not self.log_resource_inited:
self.init_log_resource(self.get_hook())
+ if (
+ self.instance_count is None
+ or self.state is None
+ or self.last_description is None
+ or self.last_describe_job_call is None
+ ):
+ raise AirflowException(
+ "instance_count, state, last_description,
last_describe_job_call must be specified"
Review comment:
I think it is better to specify the initial value of the class rather
than generating an error.
```
self.instance_count = 1
self.state = LogState.STARTING
self.last_description = {}
self.last_describe_job_call = 0
self.log_resource_inited = False
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]