HumanSignal/label-studio-sdk

client.tasks.list with fields="all" fails

matnel opened this issue · 3 comments

While I tried to see if I can fix #237 with client.tasks.list( project = "1", fields = "all" ) I get following error:

File "/opt/homebrew/lib/python3.10/site-packages/label_studio_sdk/tasks/client.py", line 197, in list
   _parsed_response = pydantic_v1.parse_obj_as(TasksListResponse, _response.json())  # type: ignore
 File "pydantic/tools.py", line 38, in pydantic.tools.parse_obj_as
 File "pydantic/main.py", line 342, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 40 validation errors for ParsingModel[TasksListResponse]
__root__ -> tasks -> 0 -> file_upload
 value is not a valid integer (type=type_error.integer)
__root__ -> tasks -> 1 -> file_upload
 value is not a valid integer (type=type_error.integer)

But it works fine when I do client._client_wrapper.httpx_client.request(f"api/tasks/", data = {"project": "1", "page_size": 10000,"fields":"all"} ,method="GET").json()

@matnel thanks for reporting this. The fix is included in #236
It will be merged today and released as part of 1.0.1 version.

@matnel, please update the latest version of pip install -U label-studio-sdk>=1.0.1
Let me know if the issue still persists, otherwise we can close it

@matnel thanks for reporting the initial bug, feel free to create a new issue or message me on Slack if the issue persists (and I'll reopen this issue for more discussion)