-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: move sagemaker config loading to LocalSession since it is only used for local code support. #1137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…for local code support.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
src/sagemaker/local/image.py
Outdated
|
||
try: | ||
import yaml | ||
except ImportError as e: | ||
logging.warning( | ||
"yaml failed to import. Local mode features will be impaired or broken." | ||
) | ||
# Any subsequent attempt to use yaml will raise the ImportError | ||
yaml = sagemaker.utils.DeferredError(e) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should refactor this pattern into its own utility function at this point
src/sagemaker/local/local_session.py
Outdated
import platform | ||
import os |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these two lines should be swapped (for alphabetical order)
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 |
py_module (str): Module that failed to be imported | ||
feature (str): Affected sagemaker feature | ||
extras (str): Name of the extra_requirements to install all of the dependencies | ||
Returns: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add a newline before "Returns"
Args: | ||
py_module (str): Module that failed to be imported | ||
feature (str): Affected sagemaker feature |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/sagemaker/SageMaker
Args: | ||
py_module (str): Module that failed to be imported | ||
feature (str): Affected sagemaker feature | ||
extras (str): Name of the extra_requirements to install all of the dependencies |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- s/extra_requirements/
extras_require
(with backticks) - s/all of the/the relevant
str: Error message with installation instructions. | ||
""" | ||
error_msg = ( | ||
"Failed to import {}. {} features will be impaired or broken." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: need a space after the second period
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 |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Merge Checklist
Put an
x
in 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.