Skip to content

Commit

Permalink
The CollectedEvent.data type is now Mapping instead of Dict
Browse files Browse the repository at this point in the history
This allows to use `TypedDict`'s for that attribute.

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
  • Loading branch information
s0undt3ch committed May 15, 2023
1 parent b710075 commit e46d9e3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog/30.improvement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The `CollectedEvent.data` type is now `Mapping` instead of `Dict`. This allows to use `TypedDict`'s for that attribute.
3 changes: 2 additions & 1 deletion src/saf/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from typing import Dict
from typing import Generic
from typing import List
from typing import Mapping
from typing import Optional
from typing import Type
from typing import TypeVar
Expand Down Expand Up @@ -299,7 +300,7 @@ class CollectedEvent(BaseModel):
Class representing each of the collected events.
"""

data: Dict[str, Any]
data: Mapping[str, Any]
timestamp: Optional[datetime] = Field(default_factory=dt.utcnow)


Expand Down

0 comments on commit e46d9e3

Please sign in to comment.