cancervariants / metakb

Central repository for the VICC metakb web application
MIT License
15 stars 4 forks source link

Resolve pydantic serializer warnings #347

Closed jsstevenson closed 3 months ago

jsstevenson commented 3 months ago

Encountered during tests (in 3.12, Pydantic 2.7.1)

tests/unit/transform/test_civic_transform_therapeutic.py::test_civic_cdm
tests/unit/transform/test_moa_transform.py::test_moa_cdm
  /Users/jss009/code/metakb/.venv/lib/python3.12/site-packages/pydantic/main.py:347: UserWarning: Pydantic serializer warnings:
    Expected `enum` but got `str` - serialized value may not be as expected
    Expected `enum` but got `str` - serialized value may not be as expected
    Expected `enum` but got `str` - serialized value may not be as expected
    Expected `enum` but got `str` - serialized value may not be as expected
    Expected `enum` but got `str` - serialized value may not be as expected
    Expected `enum` but got `str` - serialized value may not be as expected
    Expected `enum` but got `str` - serialized value may not be as expected
    Expected `enum` but got `str` - serialized value may not be as expected
    Expected `enum` but got `str` - serialized value may not be as expected
    return self.__pydantic_serializer__.to_python(

tests/unit/transform/test_civic_transform_therapeutic.py::test_civic_cdm
tests/unit/transform/test_moa_transform.py::test_moa_cdm
  /Users/jss009/code/metakb/.venv/lib/python3.12/site-packages/pydantic/main.py:347: UserWarning: Pydantic serializer warnings:
    Expected `enum` but got `str` - serialized value may not be as expected
    Expected `enum` but got `str` - serialized value may not be as expected
    Expected `enum` but got `str` - serialized value may not be as expected
    Expected `enum` but got `str` - serialized value may not be as expected
    Expected `enum` but got `str` - serialized value may not be as expected
    Expected `enum` but got `str` - serialized value may not be as expected
    Expected `enum` but got `str` - serialized value may not be as expected
    return self.__pydantic_serializer__.to_python(

Probably doesn't have any practical implications, but should be addressed

jsstevenson commented 3 months ago

root of the issue is something about source meta in thera-py, if i'm not mistaken