HumanSignal / label-studio-sdk

Label Studio SDK
https://api.labelstud.io
Apache License 2.0
89 stars 58 forks source link

[Bug] validation error for User org_membership from Client.get_users() #186

Open jaemin93 opened 7 months ago

jaemin93 commented 7 months ago

I encountered an error while using the get_users method from the Client class. The error message is as follows:

 File "C:\Users\iceba\workspace\projects\utils\annotation\labelstudio_utils.py", line 31, in delete_user
    for user in ls_client.get_users():
                ^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\iceba\anaconda3\envs\controller\Lib\site-packages\label_studio_sdk\client.py", line 271, in get_users
    users.append(User(**user_data))
                 ^^^^^^^^^^^^^^^^^
  File "c:\Users\iceba\anaconda3\envs\controller\Lib\site-packages\pydantic\main.py", line 171, in __init__
    self.__pydantic_validator__.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 1 validation error for User org_membership

If set None as the default value for the org_membership field in User, this error will no longer occur.