Skip to content
This repository was archived by the owner on Feb 25, 2023. It is now read-only.
This repository was archived by the owner on Feb 25, 2023. It is now read-only.

Loading a work crashes when oa_status is blank #13

@v0idness

Description

@v0idness

Hi,

I'm experiencing the following issue whenever I retrieve a work that has no information given for the oa_status variable (example: https://api.openalex.org/works/W2150191218):

oa = openalexapi.OpenAlex()
oa.get_single_work("https://openalex.org/W2150191218")

yields:

Traceback (most recent call last):
File "mappings/openalex.py", line 5, in
oa.get_single_work("https://openalex.org/W2150191218")
File "env/lib/python3.8/site-packages/openalexapi/init.py", line 35, in get_single_work
return Work(**response.json())
File "pydantic/main.py", line 341, in pydantic.main.BaseModel.init
pydantic.error_wrappers.ValidationError: 1 validation error for Work
open_access -> oa_status
none is not an allowed value (type=type_error.none.not_allowed)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions