parkerhancock / patent_client

A collection of ORM-style clients to public patent data
Other
87 stars 34 forks source link

Exception has occurred: ValidationError 1 validation error for PublicSearchDocument Value error, year 0 is out of range [type=value_error, input_value= #166

Open Tylersuard opened 4 months ago

Tylersuard commented 4 months ago

Exception has occurred: ValidationError 1 validation error for PublicSearchDocument Value error, year 0 is out of range [type=value_error, input_value={'guid': 'US-5626587-A', ...tNumberOne': '05626587'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.7/v/value_error File "C:\Users\tyler\OneDrive\Desktop\App Ideas and Work\AI USPTO\download_all_patents_by_number.py", line 13, in pat = Patent.objects.get(patent_number) pydantic_core._pydantic_core.ValidationError: 1 validation error for PublicSearchDocument Value error, year 0 is out of range [type=value_error, input_value={'guid': 'US-5626587-A', ...tNumberOne': '05626587'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.7/v/value_error

Here is my code:

for patent_number in patent_numbers: pat = Patent.objects.get(patent_number)

parkerhancock commented 4 months ago

Huh. I need to add a bit of logic to handle unset dates in older patents. I'll add that to my to-do list.