Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pydantic): use pydantic serialization #2139

Merged
merged 12 commits into from
Sep 17, 2024
Merged

Conversation

MartinBelthle
Copy link
Contributor

@MartinBelthle MartinBelthle commented Sep 17, 2024

fix [ANT-2052]

antarest/tools/lib.py Outdated Show resolved Hide resolved
services["cache"] = cache
services["maintenance"] = maintenance_service
return services
def to_json(data: t.Any, indent: t.Optional[int] = None) -> bytes:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would you think about moving this to a core.serialization module ? Something more targetted than the plain "utils".

Also we should add a docstring to mention that we do this to benefit from the performances of pydantic serialization

Copy link
Member

@sylvlecl sylvlecl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the use of the new method to get a string should be generalized

antarest/core/serialization/utils.py Outdated Show resolved Hide resolved
antarest/eventbus/web.py Outdated Show resolved Hide resolved
antarest/core/configdata/repository.py Outdated Show resolved Hide resolved
antarest/core/configdata/repository.py Outdated Show resolved Hide resolved
@MartinBelthle
Copy link
Contributor Author

Indeed I was lazy

@MartinBelthle MartinBelthle self-assigned this Sep 17, 2024
@sylvlecl sylvlecl merged commit 1855bf4 into dev Sep 17, 2024
10 of 11 checks passed
@sylvlecl sylvlecl deleted the fix/use-pydantic-serialization branch September 17, 2024 14:45
@makdeuneuv makdeuneuv added this to the v2.18 milestone Sep 18, 2024
maugde pushed a commit that referenced this pull request Sep 26, 2024
This will allow to benefit from improved serialization performances
of pydantic v2, even for non-pydantic classes.

fix [ANT-2052]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants