-
Notifications
You must be signed in to change notification settings - Fork 473
Tech debt: Use dispatch dict for proxy event conversion #8120
Copy link
Copy link
Labels
pending-releaseFix or implementation already in dev waiting to be releasedFix or implementation already in dev waiting to be releasedtech-debtTechnical Debt tasksTechnical Debt tasks
Description
Why is this needed?
_to_proxy_event() has 7 sequential if/return statements (suppressed with # noqa PLR0911). A simple dict mapping ProxyEventType to event class replaces all of them.
Steps:
- Create
PROXY_EVENT_MAP: dict[ProxyEventType, type[BaseProxyEvent]]at module level - Replace the if-chain with a dict lookup
- Remove the noqa
Which area does this relate to?
Event Handler - REST API
Suggestion
No response
Acknowledgment
- This request meets Powertools for AWS Lambda (Python) Tenets
- Should this be considered in other Powertools for AWS Lambda languages? i.e. Java, TypeScript, and .NET
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
pending-releaseFix or implementation already in dev waiting to be releasedFix or implementation already in dev waiting to be releasedtech-debtTechnical Debt tasksTechnical Debt tasks
Type
Projects
Status
Coming soon