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

JSONStore: fix last_updated serialization problem #735

Merged
merged 5 commits into from
Oct 25, 2022

Conversation

rkingsbury
Copy link
Collaborator

@rkingsbury rkingsbury commented Oct 25, 2022

datetime objects serialize to str when using the orjson library, which breaks the last_updated functionality when a JSONStore is written and read back from disk. This PR fixes that problem by ensuring that the last_updated field, which is stored as a str, is properly deserialized into a datetime.

Also adds a new test and an additional test of the last_updated functionality in MontyStore.

@codecov
Copy link

codecov bot commented Oct 25, 2022

Codecov Report

Base: 88.37% // Head: 88.38% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (3703012) compared to base (fe2a735).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #735      +/-   ##
==========================================
+ Coverage   88.37%   88.38%   +0.01%     
==========================================
  Files          41       41              
  Lines        3123     3126       +3     
==========================================
+ Hits         2760     2763       +3     
  Misses        363      363              
Impacted Files Coverage Δ
src/maggma/stores/mongolike.py 88.07% <100.00%> (+0.09%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@munrojm
Copy link
Member

munrojm commented Oct 25, 2022

Thanks @rkingsbury! Happy for me to merge?

@rkingsbury
Copy link
Collaborator Author

Yep I'm good for you to merge!

@munrojm munrojm merged commit 2606f86 into materialsproject:main Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants