Skip to content
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

Default execution name should be generated in flyteadmin #2678

Merged
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]
pingsutw marked this conversation as resolved.
Show resolved Hide resolved
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
Loading