HumanSignal / label-studio-sdk

Label Studio SDK
https://api.labelstud.io
77 stars 50 forks source link

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

Closed matnel closed 1 week ago

matnel commented 2 weeks ago

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()

niklub commented 2 weeks ago

@matnel thanks for reporting this. The fix is included in https://github.com/HumanSignal/label-studio-sdk/pull/236 It will be merged today and released as part of 1.0.1 version.

niklub commented 2 weeks ago

@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

sajarin commented 1 week ago

@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)