Skip to content

Add the missing ExecutionMetadata.ExecutionMode values - #3480

Open
1fanwang wants to merge 3 commits into
flyteorg:masterfrom
1fanwang:1fanwang/execution-mode-enum
Open

1fanwang wants to merge 3 commits into
flyteorg:masterfrom
1fanwang:1fanwang/execution-mode-enum

Conversation

@1fanwang

@1fanwang 1fanwang commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Tracking issue

No tracking issue.

Why are the changes needed?

Relaunched executions deserialize into the SDK, but callers cannot identify them by name because ExecutionMode omits the service's RELAUNCH value:

AttributeError: type object 'ExecutionMode' has no attribute 'RELAUNCH'

What changes were proposed in this pull request?

Expose the execution modes from the generated admin proto while preserving the existing numeric values. The definition is in the admin proto.

How was this patch tested?

Testing Done

An admin protobuf for a relaunched execution goes through the SDK conversion used for fetched metadata. This validates that conversion and the named comparison, not a live service fetch.

Scenario Command Result
Relaunch metadata conversion python relaunch_mode.py mode: 3; relaunched: True
Reproducer source: relaunch_mode.py
from flyteidl.admin import execution_pb2

from flytekit.models.execution import ExecutionMetadata

pb = execution_pb2.ExecutionMetadata(
    mode=execution_pb2.ExecutionMetadata.RELAUNCH,
    principal="example-user",
)
metadata = ExecutionMetadata.from_flyte_idl(pb)
print("mode:", metadata.mode)
print("relaunched:", metadata.mode == ExecutionMetadata.ExecutionMode.RELAUNCH)
assert metadata.mode == ExecutionMetadata.ExecutionMode.RELAUNCH
python relaunch_mode.py
mode: 3
relaunched: True
exit_code=0

Before the change, the same conversion returned mode 3 but the named comparison raised the AttributeError above.

Setup process

Python 3.12 with the SDK development environment and this checkout on PYTHONPATH.

Screenshots

Not applicable.

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

None.

Docs link

No separate documentation change.

ExecutionMode listed MANUAL, SCHEDULED and SYSTEM, but the admin proto
also defines RELAUNCH, CHILD_WORKFLOW, RECOVERED and TRIGGER, so code
checking a fetched execution for one of those modes raised
AttributeError. Take every value from the generated proto, as
WorkflowExecutionPhase does, and test against the proto enum.

Signed-off-by: 1fanwang <1fannnw@gmail.com>
Signed-off-by: 1fanwang <1fannnw@gmail.com>
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.

1 participant