-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: double Run create on load_run #3821
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
45a3717
to
fb34f93
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
fb34f93
to
8694237
Compare
src/sagemaker/experiments/run.py
Outdated
@@ -843,7 +844,6 @@ def list_runs( | |||
created_after: Optional[datetime.datetime] = None, | |||
sagemaker_session: Optional["Session"] = None, | |||
max_results: Optional[int] = None, | |||
next_token: Optional[str] = None, |
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.
To remove a field from a public method can be a breaking change. Is it causing any issues so we need to remove it?
Or are we sure the list_runs
is not widely used? If so it's fine to remove it
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.
the argument is unusable as it currently is, so no one is currently using it
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.
+1 on @qidewenwhen 's comment.
Can we keep this parameter in public method but instead doing nothing with it?
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.
ill separate the next_token change from the bug fix and we can discuss what to do with it separately
sort_by (SortByType): The property to sort results by. One of NAME, CREATION_TIME | ||
(default: CREATION_TIME). | ||
sort_order (SortOrderType): One of ASCENDING, or DESCENDING (default: DESCENDING). | ||
|
||
Returns: | ||
list: A list of ``Run`` objects. | ||
""" | ||
|
||
# all trial components retrieved by default |
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.
You mean the _TrialComponent.list
can retrieve all trial components?
sagemaker-python-sdk/src/sagemaker/experiments/trial_component.py
Lines 248 to 262 in 8d2c16b
return super(_TrialComponent, cls)._list( | |
"list_trial_components", | |
_api_types.TrialComponentSummary.from_boto, | |
"TrialComponentSummaries", | |
source_arn=source_arn, | |
created_before=created_before, | |
created_after=created_after, | |
sort_by=sort_by, | |
sort_order=sort_order, | |
sagemaker_session=sagemaker_session, | |
trial_name=trial_name, | |
experiment_name=experiment_name, | |
max_results=max_results, | |
next_token=next_token, | |
) |
Or the list trial component API can retrieve all TCs in one call?
If the next_token is not causing any issues, I'd suggest to keep it to avoid a breaking change
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.
all trial components are retrieved by default:
The problem with this parameter is where is the customer going to get the next_token to supply to method in the first place? The only way to get next_token is to call ListTrialComponents
in which case they have no reason to use this method.
Also this method doesn't return a NextToken
.
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 prefer to remove since it is not providing useful behavior as it currently is. In the future we could re-add it but will need to return a NextToken so the customer can supply it in their own page-loop behavior.
# TODO: we should revert the lower casting once backend fix reaches prod | ||
return trial_component_name.replace( | ||
"{}{}".format(experiment_name.lower(), DELIMITER), "", 1 | ||
) |
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.
Good catch! So I assume this line would fix the issue of second run created? And will fix the list_runs issue #3673?
Can we add a unit test which does list_runs twice in case to validate in case any future changes break it again?
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.
sure, will do
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 |
Codecov Report
@@ Coverage Diff @@
## master #3821 +/- ##
==========================================
- Coverage 89.71% 88.99% -0.72%
==========================================
Files 1060 247 -813
Lines 101652 25134 -76518
==========================================
- Hits 91193 22368 -68825
+ Misses 10459 2766 -7693
|
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
8694237
to
7d7bf2c
Compare
Updates:
|
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 |
0e55555
to
ed38720
Compare
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 |
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 |
e2a0307
to
883d028
Compare
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 |
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 |
5a9cd8c
to
0626b0a
Compare
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 |
Issue #, if available: #3673
Description of changes: Fixes a bug in
load_run
which would result in a second Run created with a similar nameTesting done:
tox -e py39 -- tests/unit/sagemaker/experiments
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.