Replaced generic ValueError with custom subclass when reporting unexpected resource status#855
Replaced generic ValueError with custom subclass when reporting unexpected resource status#855arodiss wants to merge 3 commits into
Conversation
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
Hello @arodiss, thanks for the contribution. Any special reasoning behinds creating a new special exception? I would tend to just use |
|
@mvsusp |
|
Agreed that is helpful in your use case. Thanks for your contribution! |
| @@ -0,0 +1,9 @@ | |||
| from __future__ import absolute_import | |||
| ) | ||
| return desc | ||
|
|
||
| def create_endpoint_config(self, name, model_name, initial_instance_count, instance_type, |
There was a problem hiding this comment.
Please include unit tests, example
| message='Error for {} {}: {} Reason: {}'.format(job_type, job, status, reason), | ||
| allowed_statuses=['Completed', 'Stopped'], | ||
| actual_status=status | ||
| ) |
There was a problem hiding this comment.
We need unit tests here as well.
| allowed_statuses=['InService'], | ||
| actual_status=status | ||
| ) | ||
| return desc |
| from sagemaker import vpc_utils | ||
| from sagemaker.user_agent import prepend_user_agent | ||
| from sagemaker.utils import name_from_image, secondary_training_status_changed, secondary_training_status_message | ||
| from sagemaker.exceptions import UnexpectedStatusException |
There was a problem hiding this comment.
Let's try to follow Google Python Style guide, http://google.github.io/styleguide/pyguide.html#224-decision
from sagemaker import exceptionsThere was a problem hiding this comment.
updated.
I have to mention that other imports in the same file are quite far from the guide
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
…ng unexpected resource status
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
@mvsusp |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
…ng unexpected resource status
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
Moved to #919 |
Issue #, if available:
None
Description of changes:
Replaced generic ValueError with custom subclass when reporting unexpected resource status
Merge Checklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.