You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If you pass None as your api_key and you don't have your LABEL_STUDIO_API_KEY env var set when creating a label_studio_sdk.Client, you'll get an AttributeError when trying to access credentials.api_key.
This happens because, the check for api_key being None and using credentials is wrong on client.py:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/path/to/label_studio_sdk/client.py", line 90, in __init__
if credentials.api_key
AttributeError: 'NoneType' object has no attribute 'api_key'
Expected behavior
Since you can't really do anything at this point (no api_key and no credentials), the SDK should just raise an error with a better error message. It's a small change and I could probably make a PR for it when I have some time 😅, but just thought of creating the issue in case anyone is able to fix this first.
The text was updated successfully, but these errors were encountered:
Describe the bug
If you pass
None
as yourapi_key
and you don't have yourLABEL_STUDIO_API_KEY
env var set when creating alabel_studio_sdk.Client
, you'll get anAttributeError
when trying to accesscredentials.api_key
.This happens because, the check for
api_key
beingNone
and usingcredentials
is wrong on client.py:label-studio-sdk/label_studio_sdk/client.py
Lines 83 to 92 in 415049a
To Reproduce
Run the following without setting your
LABEL_STUDIO_API_KEY
env var.Expected behavior
Since you can't really do anything at this point (no api_key and no credentials), the SDK should just raise an error with a better error message. It's a small change and I could probably make a PR for it when I have some time 😅, but just thought of creating the issue in case anyone is able to fix this first.
The text was updated successfully, but these errors were encountered: