acoustic-carpenter-78188
02/25/2026, 12:34 AMEnumTransformer.assert_type was validating string inputs against enum values (e.g. "red"), but the transformer serializes regular enums by name (e.g. "RED") everywhere else (get_literal_type, to_literal, to_python_value)
• This caused flyte run --param '["RED"]' to fail with Value RED is not in Enum <enum 'Color'> even though "RED" is a valid enum name
• Fix assert_type to accept both enum names and values for string inputs, consistent with the rest of the transformer
Test plan
• pytest tests/flyte/type_engine/test_enum.py — all 4 tests pass, including two new tests:
• `test_enum_assert_type_accepts_name`: verifies "RED" is accepted for Color.RED = "red"
• `test_enum_in_list_accepts_name`: verifies ["RED", "BLUE"] works for List[Color] (the original failing case)
• Manually verified: flyte run kevin_examples/test.py test_enum --c '["RED"]' now succeeds
import enum
import typing
import flyte
class Color(enum.Enum):
RED = "red"
GREEN = "green"
BLUE = "blue"
env = flyte.TaskEnvironment(name="test")
@env.task
def test_enum(c: typing.List[Color]) -> str:
return f"Color is {c[0].value}"
if name == "__main__":
flyte.init_from_config(images="docker.io/pingsutw/test:latest")
result = flyte.run(test_enum, c=[Color.RED])
print(result.url)
flyteorg/flyte-sdkacoustic-carpenter-78188
02/25/2026, 1:24 AM