Skip to content

Commit

Permalink
Default execution name should be generated in flyteadmin (#2678)
Browse files Browse the repository at this point in the history
Signed-off-by: wayner0628 <a901639@gmail.com>
Signed-off-by: Kevin Su <pingsutw@apache.org>
Co-authored-by: Kevin Su <pingsutw@apache.org>
  • Loading branch information
wayner0628 and pingsutw authored Aug 25, 2024
1 parent a50eb4b commit 54f0a46
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions flytekit/remote/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -1144,8 +1144,9 @@ def _execute(
"""
if execution_name is not None and execution_name_prefix is not None:
raise ValueError("Only one of execution_name and execution_name_prefix can be set, but got both set")
execution_name_prefix = execution_name_prefix + "-" if execution_name_prefix is not None else None
execution_name = execution_name or (execution_name_prefix or "f") + uuid.uuid4().hex[:19]
# todo: The prefix should be passed to the backend
if execution_name_prefix is not None:
execution_name = execution_name_prefix + "-" + uuid.uuid4().hex[:19]
if not options:
options = Options()
if options.disable_notifications is not None:
Expand Down
2 changes: 1 addition & 1 deletion tests/flytekit/unit/remote/test_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ def test_execution_name(mock_client, mock_uuid):
[
mock.call(ANY, ANY, "execution-test", ANY, ANY),
mock.call(ANY, ANY, "execution-test-" + test_uuid.hex[:19], ANY, ANY),
mock.call(ANY, ANY, "f" + test_uuid.hex[:19], ANY, ANY),
mock.call(ANY, ANY, None, ANY, ANY),
]
)
with pytest.raises(
Expand Down

0 comments on commit 54f0a46

Please sign in to comment.