Skip to content

fix(experiments/run.py): Stop duplication of RUN_TC_TAG on Consecutive Experiment Runs #3608

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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/sagemaker/experiments/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,8 @@ def _append_run_tc_label_to_tags(tags: Optional[List[Dict[str, str]]] = None) ->
"""
if not tags:
tags = []
tags.append(RUN_TC_TAG)
if RUN_TC_TAG not in tags:
tags.append(RUN_TC_TAG)
return tags

def __enter__(self):
Expand Down
5 changes: 5 additions & 0 deletions tests/unit/sagemaker/experiments/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,11 @@ def test_append_run_tc_label_to_tags():
assert len(ret) == 2
assert expected_tc_tag in ret

tags = [expected_tc_tag]
ret = Run._append_run_tc_label_to_tags(tags)
assert len(ret) == 1
assert expected_tc_tag in ret


def _verify_tc_status_before_enter_init(trial_component):
assert not trial_component.start_time
Expand Down