Skip to content

Add Search Expression support #70

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 9 commits into from
Apr 8, 2020
Merged

Add Search Expression support #70

merged 9 commits into from
Apr 8, 2020

Conversation

l2yao
Copy link
Contributor

@l2yao l2yao commented Apr 8, 2020

Issue #, if available:

Description of changes:

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

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@l2yao l2yao requested a review from a team as a code owner April 8, 2020 02:24
GREATER_THAN_OR_EQUAL = "GreaterThanOrEqualTo"
LESS_THAN = "LessThan"
LESS_THAN_OR_EQUAL = "LessThanOrEqualTo"
CONTAINS = "Contains"
Copy link
Member

Choose a reason for hiding this comment

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

should the "In" operator also be in this list?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Operator list is taken from boto spec: https://boto3.amazonaws.com/v1/documentation/api/1.12.8/reference/services/sagemaker.html#SageMaker.Client.search

I only listed all available options from there.

Choose a reason for hiding this comment

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

IN will be released today.

search_filter = Filter(name="ExperimentName", operator=Operator.CONTAINS, value="smexperiments-integ-")
search_expression = SearchExpression(filters=[search_filter])
for s in Experiment.search(
search_expression=search_expression.to_boto(), max_results=10, sagemaker_boto_client=sagemaker_boto_client
Copy link
Member

Choose a reason for hiding this comment

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

can we avoid calling code using "to_boto"? Seems like the usage would be cleaner without it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agree and removed the need for to_boto here

@l2yao l2yao merged commit a121057 into aws:master Apr 8, 2020
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.

3 participants