-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Added handler for pipeline variable while creating process job #5122
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
…aining script which can misguide users.Training script can be of latest version based on the support provided by framework_version of the container
src/sagemaker/processing.py
Outdated
def _normalize_pipeline_variable(self, value): | ||
"""Helper function to normalize PipelineVariable objects""" |
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.
What does normalize mean in this case ?
Is this like a to_string
? We can probably rename this .
src/sagemaker/processing.py
Outdated
if isinstance(value, Parameter): | ||
return str(value.default_value) if value.default_value is not None else None | ||
|
||
elif isinstance(value, ExecutionVariable): | ||
return f"{value.name}" | ||
|
||
elif isinstance(value, Join): | ||
normalized_values = [ | ||
normalize_pipeline_variable(v) if isinstance(v, PipelineVariable) else str(v) | ||
for v in value.values | ||
] | ||
return value.on.join(normalized_values) |
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.
So this function is only called on value being PipelineVariable
right ?
Why do we need the rest of the If conditions ?
src/sagemaker/processing.py
Outdated
elif isinstance(value, PipelineVariable): | ||
if hasattr(value, 'default_value'): | ||
return str(value.default_value) | ||
elif hasattr(value, 'expr'): | ||
return str(value.expr) |
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.
Can we instead overload the __str__
function within the class ?
src/sagemaker/processing.py
Outdated
@@ -499,6 +509,37 @@ def _normalize_outputs(self, outputs=None): | |||
normalized_outputs.append(output) | |||
return normalized_outputs | |||
|
|||
def _normalize_pipeline_variable(self, value): |
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.
Please add data types and return types
* change: Allow telemetry only in supported regions * change: Allow telemetry only in supported regions * change: Allow telemetry only in supported regions * change: Allow telemetry only in supported regions * change: Allow telemetry only in supported regions * documentation: Removed a line about python version requirements of training script which can misguide users.Training script can be of latest version based on the support provided by framework_version of the container * feature: Enabled update_endpoint through model_builder * fix: fix unit test, black-check, pylint errors * fix: fix black-check, pylint errors * fix:Added handler for pipeline variable while creating process job * fix: Added handler for pipeline variable while creating process job * Revert the PR changes: #5122, due to issue https://t.corp.amazon.com/P223568185/overview * Fix: fix the issue, https://t.corp.amazon.com/P223568185/communication --------- Co-authored-by: Roja Reddy Sareddy <[email protected]>
* change: Allow telemetry only in supported regions * change: Allow telemetry only in supported regions * change: Allow telemetry only in supported regions * change: Allow telemetry only in supported regions * change: Allow telemetry only in supported regions * documentation: Removed a line about python version requirements of training script which can misguide users.Training script can be of latest version based on the support provided by framework_version of the container * feature: Enabled update_endpoint through model_builder * fix: fix unit test, black-check, pylint errors * fix: fix black-check, pylint errors * fix:Added handler for pipeline variable while creating process job * fix: Added handler for pipeline variable while creating process job * Revert the PR changes: #5122, due to issue https://t.corp.amazon.com/P223568185/overview * Fix: fix the issue, https://t.corp.amazon.com/P223568185/communication * Revert PR 5122 changes, due to issues with other processor codeflows --------- Co-authored-by: Roja Reddy Sareddy <[email protected]> Co-authored-by: Zhaoqi <[email protected]>
* change: Allow telemetry only in supported regions * change: Allow telemetry only in supported regions * change: Allow telemetry only in supported regions * change: Allow telemetry only in supported regions * change: Allow telemetry only in supported regions * documentation: Removed a line about python version requirements of training script which can misguide users.Training script can be of latest version based on the support provided by framework_version of the container * feature: Enabled update_endpoint through model_builder * fix: fix unit test, black-check, pylint errors * fix: fix black-check, pylint errors * fix:Added handler for pipeline variable while creating process job * fix: Added handler for pipeline variable while creating process job --------- Co-authored-by: Roja Reddy Sareddy <[email protected]>
* change: Allow telemetry only in supported regions * change: Allow telemetry only in supported regions * change: Allow telemetry only in supported regions * change: Allow telemetry only in supported regions * change: Allow telemetry only in supported regions * documentation: Removed a line about python version requirements of training script which can misguide users.Training script can be of latest version based on the support provided by framework_version of the container * feature: Enabled update_endpoint through model_builder * fix: fix unit test, black-check, pylint errors * fix: fix black-check, pylint errors * fix:Added handler for pipeline variable while creating process job * fix: Added handler for pipeline variable while creating process job * Revert the PR changes: #5122, due to issue https://t.corp.amazon.com/P223568185/overview * Fix: fix the issue, https://t.corp.amazon.com/P223568185/communication --------- Co-authored-by: Roja Reddy Sareddy <[email protected]>
Issue #, if available:
#3425
Description of changes:
PipelineVariable
to handle json serialization error inarguments
before invokingcreate_process_job
Testing done:
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.General
Tests
unique_name_from_base
to create resource names in integ tests (if appropriate)By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.