Skip to content

Commit 6405ae8

Browse files
[bug/client codegen] local_discriminator should be stable (#104)
What changed and Why === When there are multiple discriminator choices, we should just choose the first one. Test plan ========= Manual verification via repl
1 parent c3a7da3 commit 6405ae8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

replit_river/codegen/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def flatten_union(tpe: RiverType) -> list[RiverType]:
193193
""".strip()
194194
)
195195
if local_discriminators:
196-
local_discriminator = local_discriminators.pop()
196+
local_discriminator = sorted(local_discriminators).pop()
197197
else:
198198
local_discriminator = "FIXME: Ambiguous discriminators"
199199
typeddict_encoder.append(

0 commit comments

Comments
 (0)