acoustic-carpenter-78188
06/11/2026, 5:50 PMEnumTransformer.assert_type accepts a raw string that matches one of the enum's values (for instance an enum default supplied as a string), but EnumTransformer.to_literal rejects that same string with Expected an enum. So a matching-string value passes type-checking and then fails at serialization.
What changes were proposed in this pull request?
to_literal now accepts a string matching one of the enum's values and serializes it to the corresponding literal, consistent with assert_type. A non-matching string is still rejected.
How was this patch tested?
Added test_enum_to_literal_accepts_matching_string — it fails on the current code with TypeTransformerFailedError: Expected an enum and passes with the fix.
Check all the applicable boxes
• I updated the documentation accordingly.
• All new and existing tests passed.
• All commits are signed-off.
flyteorg/flytekitacoustic-carpenter-78188
07/01/2026, 2:52 AM