Commit ab95ace
committed
Use .get() for discriminator access in generated union encoders
The discriminator field may be NotRequired in the TypedDict, so direct
key access (x["key"]) triggers pyright's reportTypedDictNotRequiredAccess.
Using .get() is safe because a missing key returns None, which won't match
any discriminator value and falls through to the next branch.1 parent 35ea72f commit ab95ace
File tree
2 files changed
+2
-2
lines changed- src/replit_river/codegen
- tests/v1/codegen/snapshot/snapshots/test_unknown_enum/enumService
2 files changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
345 | | - | |
| 345 | + | |
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
0 commit comments