Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Adding check for invalid Client instantiation #146

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

GuilhermeFreire
Copy link
Contributor

@GuilhermeFreire GuilhermeFreire commented Aug 10, 2023

This solves #145
I just added a check and error message in case the user attempts to instantiate the Client improperly.

Now this is what happens if you instantiate a Client with no arguments and no env var set:

>>> import label_studio_sdk
>>> label_studio_sdk.Client()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/path/to/label_studio_sdk/client.py", line 90, in __init__
    raise RuntimeError(
RuntimeError: If neither 'api_key' nor 'credentials' are provided, 'LABEL_STUDIO_API_KEY' environment variable must be set

@GuilhermeFreire GuilhermeFreire changed the title Adding check for invalid Client instantiation [fix] Adding check for invalid Client instantiation Aug 10, 2023
@GuilhermeFreire GuilhermeFreire changed the title [fix] Adding check for invalid Client instantiation fix: Adding check for invalid Client instantiation Aug 10, 2023
@niklub niklub self-requested a review March 5, 2024 15:51
@niklub niklub merged commit eba92a1 into HumanSignal:master Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants