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

write all NaN and NaT Dataframe created values as null #929

Merged
merged 1 commit into from Feb 29, 2024

Conversation

kbuma
Copy link
Contributor

@kbuma kbuma commented Feb 29, 2024

Summary

Some collections do not have the same set of fields present in all the documents. The underlying DataFrames implementation for OpenData store uses NaN and NaT to fill in missing values for these fields. This is incompatible with Mongo storage (no NaT) and our JSON serialization. This adds code to convert NaN and NaT values to None prior to writing the documents out to S3 in OpenDataStore.

Checklist

  • Google format doc strings added.
  • Code linted with ruff. (For guidance in fixing rule violates, see rule list)
  • Type annotations included. Check with mypy.
  • Tests added for new features/fixes.
  • I have run the tests locally and they passed.

Copy link

codecov bot commented Feb 29, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 81.52%. Comparing base (f5f5593) to head (33806c1).
Report is 1 commits behind head on main.

Files Patch % Lines
src/maggma/stores/open_data.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #929      +/-   ##
==========================================
- Coverage   81.56%   81.52%   -0.05%     
==========================================
  Files          46       46              
  Lines        3938     3940       +2     
==========================================
  Hits         3212     3212              
- Misses        726      728       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@munrojm munrojm merged commit d83341e into materialsproject:main Feb 29, 2024
8 of 10 checks passed
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.

None yet

2 participants