cuddly-jelly-27016
05/23/2025, 12:09 AMinput_enum as an enum:
╭───────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────╮
│ /Users/reda/Projects/unionai_bugs/enum_remote/replicate.py:52 in <module> │
│ │
│ ❱ 52 workflow_execution = remote.execute( │
│ │
│ /Users/reda/miniconda3/envs/union_ai/lib/python3.10/site-packages/flytekit/remote/remote.py:1138 in execute │
│ │
│ ❱ 1138 │ │ │ return self.execute_remote_task_lp( │
│ │
│ /Users/reda/miniconda3/envs/union_ai/lib/python3.10/site-packages/flytekit/remote/remote.py:1227 in │
│ execute_remote_task_lp │
│ │
│ ❱ 1227 │ │ return self._execute( │
│ │
│ /Users/reda/miniconda3/envs/union_ai/lib/python3.10/site-packages/flytekit/remote/remote.py:1002 in _execute │
│ │
│ ❱ 1002 │ │ │ │ │ hint = type_hints[k] │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
KeyError: 'input_enum'
This is similar to #2278 though the error message is different
### Expected behavior
Workflow should execute
### Additional context to reproduce
Here is a script to reproduce the bug against the sandbox
import typing
from enum import Enum
import flytekit
from flytekit.remote import FlyteRemote
from flytekit.configuration import (
Config,
ImageConfig,
SerializationSettings,
FastSerializationSettings
)
class MyEnum(Enum):
FOO = "FOO"
BAR = "BAR"
@flytekit.task
def get_enum_value(input_enum: MyEnum) -> str:
return input_enum.value
@flytekit.workflow
def wf(input_enum: MyEnum) -> MyEnum:
return get_enum_value(input_enum=input_enum)
_PROJECT = "flytesnacks"
_DOMAIN = "development"
_VERSION = "abc"
remote = FlyteRemote(config=Config.for_sandbox())
img = ImageConfig.auto_default_image()
fast_serialization_settings = FastSerializationSettings(enabled=True, destination_dir="/root")
serialization_settings = SerializationSettings(
image_config=img,
project=_PROJECT,
domain=_DOMAIN,
version=_VERSION,
fast_serialization_settings=fast_serialization_settings
)
remote.register_workflow(wf, serialization_settings=serialization_settings)
remote_workflow = remote.fetch_workflow(
project=_PROJECT,
domain=_DOMAIN,
version=_VERSION,
name="wf"
)
workflow_execution = remote.execute(
remote_workflow,
inputs={"input_enum": MyEnum.FOO},
project=_PROJECT,
domain=_DOMAIN,
wait=True
)
### Screenshots
No response
### Are you sure this issue hasn't been raised already?
• Yes
### Have you read the Code of Conduct?
• Yes
flyteorg/flytecuddly-jelly-27016
05/23/2025, 12:09 AM