Skip to content

Tech debt: Use dispatch dict for proxy event conversion #8120

@leandrodamascena

Description

@leandrodamascena

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:

  1. Create PROXY_EVENT_MAP: dict[ProxyEventType, type[BaseProxyEvent]] at module level
  2. Replace the if-chain with a dict lookup
  3. Remove the noqa

Which area does this relate to?

Event Handler - REST API

Suggestion

No response

Acknowledgment

Metadata

Metadata

Labels

pending-releaseFix or implementation already in dev waiting to be releasedtech-debtTechnical Debt tasks

Projects

Status

Coming soon

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions