Commit 26f44a8
fix(typing): accept Mapping type in resolve() for event parameter (#7909)
Change resolve() event parameter type hint from dict[str, Any] to
Mapping[str, Any] to allow Powertools event data classes (e.g.,
LambdaFunctionUrlEvent) to be passed without type errors.
Use cast(dict, event) for internal method calls that expect dict type
to satisfy mypy while maintaining zero runtime overhead.
This is backwards compatible since dict is a subtype of Mapping.
Closes #7864
Co-authored-by: Leandro Damascena <[email protected]>1 parent c553712 commit 26f44a8
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2461 | 2461 | | |
2462 | 2462 | | |
2463 | 2463 | | |
2464 | | - | |
| 2464 | + | |
2465 | 2465 | | |
2466 | 2466 | | |
2467 | 2467 | | |
| |||
2514 | 2514 | | |
2515 | 2515 | | |
2516 | 2516 | | |
2517 | | - | |
| 2517 | + | |
2518 | 2518 | | |
2519 | 2519 | | |
2520 | | - | |
| 2520 | + | |
2521 | 2521 | | |
2522 | 2522 | | |
2523 | 2523 | | |
| |||
0 commit comments