Cleanup db_schema from_event constructors (#120803)
This commit is contained in:
parent
6ed0960648
commit
852bb19223
3 changed files with 50 additions and 36 deletions
|
@ -1308,6 +1308,11 @@ class EventOrigin(enum.Enum):
|
|||
"""Return the event."""
|
||||
return self.value
|
||||
|
||||
@cached_property
|
||||
def idx(self) -> int:
|
||||
"""Return the index of the origin."""
|
||||
return next((idx for idx, origin in enumerate(EventOrigin) if origin is self))
|
||||
|
||||
|
||||
class Event(Generic[_DataT]):
|
||||
"""Representation of an event within the bus."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue