cthoyt / zenodo-client

A tool for automated uploading and version management of scientific data to Zenodo
MIT License
25 stars 5 forks source link

Field required error when #19

Closed nuest closed 1 year ago

nuest commented 1 year ago

I'm creating a new Metadata object using the example from the README and get an error, which surprises me because it should not happen according to your tests:

Creator(
            name="Hoyt, Charles Tapley",
            affiliation="Harvard Medical School",
            orcid="0000-0003-4423-4370",
        )
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/daniel/git/NFDI4Earth/nfdi4earth-deliverables/lib/python3.10/site-packages/pydantic/main.py", line 159, in __init__
    __pydantic_self__.__pydantic_validator__.validate_python(data, self_instance=__pydantic_self__)
pydantic_core._pydantic_core.ValidationError: 1 validation error for Creator
gnd
  Field required [type=missing, input_value={'name': 'Hoyt, Charles T...: '0000-0003-4423-4370'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.1/v/missing

Environment:

$ pip freeze
annotated-types==0.5.0
certifi==2023.7.22
charset-normalizer==3.2.0
click==8.1.6
coloredlogs==15.0.1
humanfriendly==10.0
idna==3.4
more-click==0.1.2
pydantic==2.1.1
pydantic_core==2.4.0
pystow==0.5.0
python-dotenv==1.0.0
PyYAML==6.0.1
requests==2.31.0
tqdm==4.66.1
typing_extensions==4.7.1
urllib3==2.0.4
yaml-header-tools==0.2.1
zenodo-client==0.3.2
cthoyt commented 1 year ago

this smells like a pydantic 1/2 issue

nuest commented 1 year ago

A fix is to set gnd=None by the way.

cthoyt commented 1 year ago

I think at #20 solves this, but I need to read the issues with CI (probably stuff unrelated due to e.g., updates in sphinx)

cthoyt commented 1 year ago

20 seems to be passing tests on pydantic 1/2, please let me know if this fixes this issue