materialsproject / emmet

Be a master builder of databases of material properties. Avoid the Kragle.
https://materialsproject.github.io/emmet/
Other
52 stars 64 forks source link

Add 3 missing `Optional`s for `EmmetMeta` fields #863

Closed janosh closed 10 months ago

janosh commented 10 months ago

These 3 fields were not optional and raising validation errors from being None in atomate2 tests.

  1. builder_meta.emmet_version
  2. builder_meta.pymatgen_version
  3. builder_meta.build_date

Causing 32 tests to fail on the main branch so new emmet release this week would be much appreciated @munrojm! πŸ™

@esoteric-ephemera @hrushikesh-s @Zhuoying

codecov-commenter commented 10 months ago

Codecov Report

All modified lines are covered by tests :white_check_mark:

Comparison is base (8184d2d) 91.34% compared to head (bcdae5a) 91.34%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #863 +/- ## ======================================= Coverage 91.34% 91.34% ======================================= Files 138 138 Lines 12749 12749 ======================================= Hits 11646 11646 Misses 1103 1103 ``` | [Files](https://app.codecov.io/gh/materialsproject/emmet/pull/863?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=materialsproject) | Coverage Ξ” | | |---|---|---| | [emmet-core/emmet/core/base.py](https://app.codecov.io/gh/materialsproject/emmet/pull/863?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=materialsproject#diff-ZW1tZXQtY29yZS9lbW1ldC9jb3JlL2Jhc2UucHk=) | `100.00% <100.00%> (ΓΈ)` | |

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

munrojm commented 10 months ago

@janosh were the default values not properly populating for those fields? If they have auto-populating values, it isn't clear to me why they need to be optional.

janosh commented 10 months ago

They were not populated. pydantic was complaining about NoneType for all of them:

    __pydantic_self__.__pydantic_validator__.validate_python(data, self_instance=__pydantic_self__)
pydantic_core._pydantic_core.ValidationError: 3 validation errors for TaskDoc
builder_meta.emmet_version
  Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.4/v/string_type
builder_meta.pymatgen_version
  Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.4/v/string_type
builder_meta.build_date
  Input should be a valid datetime [type=datetime_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.4/v/datetime_type