Skip to content

fix: support maps in step parameters #2661

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

Merged
merged 2 commits into from
Sep 28, 2021
Merged

Conversation

jayatalr
Copy link
Contributor

Issue #, if available:

Description of changes: This change is made to support map types in step properties.

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

  • [ x ] I have read the CONTRIBUTING doc
  • [ x ] I certify that the changes I am introducing will be backword compatible, and I have discussed concerns about this, if any, with the Python SDK team
  • [ x ] I used the commit message format described in CONTRIBUTING
  • [ x ] I have passed the region in to all S3 and STS clients that I've initialized as part of this change.
  • [ x ] I have updated any necessary documentation, including READMEs and API docs (if appropriate)

Tests

  • [ x ] I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • [ x ] I have added unit and/or integration tests as appropriate to ensure backward compatibility of the changes
  • [ x ] I have checked that my tests are not configured for a specific region or account (if appropriate)
  • [ x ] I have used 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.

Args:
path (str): The parent path of the PropertiesMap instance.
shape_name (str): The botocore sagemaker service model shape name.
root_shape_name (str): The botocore sagemaker service model shape name.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

root_shape_name is not present in the arguments. We should remove this from doc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

@@ -855,6 +855,113 @@ def test_one_step_callback_pipeline(sagemaker_session, role, pipeline_name, regi
pass


def test_steps_with_map_params_pipeline(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be missing it but how is this testing map params?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert at line 947 and 948 are checking hyperparameter values? Do we need different asserts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated for testing hyperparameters

@jayatalr jayatalr force-pushed the master branch 2 times, most recently from ef8150d to cb7ed39 Compare September 24, 2021 22:08
@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-unit-tests
  • Commit ID: d2c9cd0
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Contributor

@shreyapandit shreyapandit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ahsan-z-khan ahsan-z-khan merged commit aa54685 into aws:master Sep 28, 2021
@@ -67,6 +67,8 @@ def __init__(
for key, info in members.items():
if Properties._shapes.get(info["shape"], {}).get("type") == "list":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think second param should be list here in get

@@ -67,6 +67,8 @@ def __init__(
for key, info in members.items():
if Properties._shapes.get(info["shape"], {}).get("type") == "list":
self.__dict__[key] = PropertiesList(f"{path}.{key}", info["shape"])
elif Properties._shapes.get(info["shape"], {}).get("type") == "map":
self.__dict__[key] = PropertiesMap(f"{path}.{key}", info["shape"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am little confused here. info[shape] is map here so why does constructor has str in it

EthanShouhanCheng pushed a commit to SissiChenxy/sagemaker-python-sdk that referenced this pull request Jan 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants