Imzachjohnson / clickupython

A client for working with the ClickUp API V2

Home Page:https://clickupython.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Task priority validation errors

AJDurant opened this issue · comments

When fetching tasks as below I'm getting validation errors for the priority. The model is expecting an int, but it's a Prority object. This is with v1.0.4 on Python 3.9.7

Looking at the model code the Priority class appears to be defined twice, and sometimes refers to int.

>>> tasks = []
>>> for list in lists:
...   tasks.extend(clickup.get_tasks(list.id, subtasks=True, include_closed=True))
... 
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "D:\home\adurant\dev\clickup2gitlab\.venv\lib\site-packages\clickupython\client.py", line 631, in get_tasks
    return models.Tasks.build_tasks(fetched_tasks)
  File "D:\home\adurant\dev\clickup2gitlab\.venv\lib\site-packages\clickupython\models.py", line 703, in build_tasks
    return Tasks(**self)
  File "pydantic\main.py", line 406, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 4 validation errors for Tasks
tasks -> 9 -> priority
  value is not a valid integer (type=type_error.integer)
tasks -> 14 -> priority
  value is not a valid integer (type=type_error.integer)
tasks -> 17 -> priority
  value is not a valid integer (type=type_error.integer)
tasks -> 32 -> priority
  value is not a valid integer (type=type_error.integer)