Use pydantic classes for json serialization
Open
- Dominant language
- Python
- Stars
- 177
- Forks
- 35
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 6
Description
The Series and AnalyzedSeries classes support serializing themselves into json, via series.as_json() calls. This is not pythonic at all. (https://github.com/apache/otava/blob/8bb5e8eaaf8d0880650ad382c557963912e9454d/otava/series.py#L109)
It seems the modern best practice is to use Pydantic classes, which are like @dataclasses but better. In particular, a pydantic object can just be cast to dict(obj) or alternatively to json. https://docs.pydantic.dev/latest/concepts/serialization/
Contributor guide
Assessment
This issue has not been assessed yet.