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

[FEATURE] allow for Field, Question and Settings initialisation without Argilla initialisation #5780

Open
christian-steinmeyer opened this issue Jan 13, 2025 · 0 comments
Assignees
Labels
type: enhancement Indicates new feature requests

Comments

@christian-steinmeyer
Copy link

Is your feature request related to a problem? Please describe.

I want to define certain things in code like Fields, Questions or Settings, e.g.

import argilla as rg

my_field = rg.TextField(...)

However, when this code is executed (even through an import of this file), it fails, if I didn't create a proper connection to a running argilla client first. I'm getting an error on the import of snippet from above, because argilla tries to set up a default client as part of the TextField instantiation and if I don't have the environment variable for api key set, I'm running into ArgillaError("Missing api_key. You must provide a valid API key."). Even if I were to set the environment variable, it would still try to make the connection to that instance. In my opinion, initialization itself shouldn't have this requirement.

Describe the solution you'd like

I think the classes that define data / structure like the ones mentioned above, should be refactored to not require a running connection at initialization. Only once they interact with a client (e.g. because they read or write something from or to the client), should there be a running connection required.

Describe alternatives you've considered

I ended up, delaying the initialization to runtime, when any code making use of that is actually called (see below). That did the trick for me but seems a bit cumbersome.

import argilla as rg
from functools import partial

my_field = partial(rg.TextField, ...)

# ...
actually_used_field = my_field()

Additional context

I'm trying to write a small CLI tool to interact with argilla programmatically, which also does other things (like notifying people about new data).

@davidberenstein1957 davidberenstein1957 changed the title [FEATURE] [FEATURE] allow for Field, Question and Settings initialisation without Argilla initialisation Jan 20, 2025
@frascuchon frascuchon added the type: enhancement Indicates new feature requests label Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Indicates new feature requests
Projects
None yet
Development

No branches or pull requests

2 participants