materialsproject / api

New API client for the Materials Project
https://materialsproject.github.io/api/
Other
105 stars 34 forks source link

Fix pydantic deserialization issues with root obj #854

Closed munrojm closed 9 months ago

munrojm commented 9 months ago

This PR converts pydantic deserialization calls to use dict(model) instead of model.model_dump() to avoid some edge cases with root level instantiated python objects being partially de-serialized.

Note this is not an issue in pydantic v1.

codecov-commenter commented 9 months ago

Codecov Report

All modified lines are covered by tests :white_check_mark:

Comparison is base (83b27a0) 70.42% compared to head (cafa16a) 70.42%. Report is 4 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #854 +/- ## ======================================= Coverage 70.42% 70.42% ======================================= Files 51 51 Lines 2482 2482 ======================================= Hits 1748 1748 Misses 734 734 ``` | [Files](https://app.codecov.io/gh/materialsproject/api/pull/854?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=materialsproject) | Coverage Δ | | |---|---|---| | [mp\_api/client/core/client.py](https://app.codecov.io/gh/materialsproject/api/pull/854?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=materialsproject#diff-bXBfYXBpL2NsaWVudC9jb3JlL2NsaWVudC5weQ==) | `82.87% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.