-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix: [Bug] Pipeline parameters (ParameterInteger, ParameterString) fail in ModelTrain (5504) #5688
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -142,7 +142,7 @@ def _get_unique_name(base, max_length=63): | |
| return unique_name | ||
|
|
||
|
|
||
| def _get_repo_name_from_image(image: str) -> str: | ||
| def _get_repo_name_from_image(image) -> str: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same issue — don't remove the type annotation, update it: def _get_repo_name_from_image(image: str | PipelineVariable) -> str | None:Note the return type should also be updated to |
||
| """Get the repository name from the image URI. | ||
|
|
||
| Example: | ||
|
|
@@ -152,11 +152,15 @@ def _get_repo_name_from_image(image: str) -> str: | |
| ``` | ||
|
|
||
| Args: | ||
| image (str): The image URI | ||
| image: The image URI (str or PipelineVariable) | ||
|
|
||
| Returns: | ||
| str: The repository name | ||
| str: The repository name, or None if image is a PipelineVariable | ||
| """ | ||
| from sagemaker.core.helper.pipeline_variable import PipelineVariable | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Move the import to the top of the module (or at minimum to the top of the function). Inline imports inside functions are acceptable for avoiding circular dependencies, but please add a comment explaining why it's done here: # Import here to avoid circular dependency
from sagemaker.core.helper.pipeline_variable import PipelineVariableAlso, is there actually a circular dependency risk? If not, this import should be at the module level with other imports. |
||
| if isinstance(image, PipelineVariable): | ||
| return None | ||
|
aviruthen marked this conversation as resolved.
|
||
| return image.split("/")[-1].split(":")[0].split("@")[0] | ||
|
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,7 +33,7 @@ | |
| StoppingCondition, | ||
| OutputDataConfig, | ||
| ) | ||
| from sagemaker.train.defaults import DEFAULT_INSTANCE_TYPE | ||
| from sagemaker.train.defaults import DEFAULT_INSTANCE_TYPE, TrainDefaults | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The test changes seem insufficient for the scope of the fix. The PR modifies validation logic in
Please add explicit unit tests for the changed behavior. Target >90% coverage per SDK standards. |
||
|
|
||
|
|
||
| DEFAULT_IMAGE = "000000000000.dkr.ecr.us-west-2.amazonaws.com/dummy-image:latest" | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.