Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ classifiers = [
"Programming Language :: Python :: 3.12"
]
dependencies = [
"dataclass-wizard==0.*",
"di[anyio]==0.79.2",
"dependency-injector>=4.48.2",
"orjson==3.*",
Expand All @@ -30,7 +31,7 @@ maintainers = [{name = "Vadim Kozyrevskiy", email = "vadikko2@mail.ru"}]
name = "python-cqrs"
readme = "README.md"
requires-python = ">=3.10"
version = "4.6.2"
version = "4.6.3"

[project.optional-dependencies]
aiobreaker = ["aiobreaker>=0.3.0"]
Expand Down
5 changes: 3 additions & 2 deletions src/cqrs/events/event.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import abc
import dataclasses
from dataclass_wizard import fromdict, asdict
import datetime
import os
import typing
Expand Down Expand Up @@ -92,7 +93,7 @@ def from_dict(cls, **kwargs) -> Self:
Returns:
A new instance of the event class.
"""
return cls(**kwargs)
return fromdict(cls, kwargs)

def to_dict(self) -> dict:
"""
Expand All @@ -101,7 +102,7 @@ def to_dict(self) -> dict:
Returns:
A dictionary containing all fields of the dataclass instance.
"""
return dataclasses.asdict(self)
return asdict(self)


class PydanticEvent(pydantic.BaseModel, IEvent, frozen=True):
Expand Down
Loading