argilla-io / argilla

Argilla is a collaboration tool for AI engineers and domain experts to build high-quality datasets
https://docs.argilla.io
Apache License 2.0
3.91k stars 367 forks source link

[BUG-python/deployment] rd.load() workspace error #4453

Closed maryc-sullivan closed 10 months ago

maryc-sullivan commented 10 months ago

Unload to pull records from a TextClassification dataset. Regardless of what I run I get either a "workspace must be provided error" or a "TypeError: Api.load() got an unexpected keyword argument 'workspace'".

Code producing the error:

>>> rg.init(api_url=ARGILLA_API_URL,  api_key=ARGILLA_API_KEY, workspace="trendina")
>>> rg.get_workspace()
'trendina'

>>> text_classification_df = rg.load(NAME, workspace = 'trendina')
TypeError: Api.load() got an unexpected keyword argument 'workspace'

>>> text_classification_df = rg.load(NAME)
argilla.client.sdk.commons.errors.BadRequestApiError: Argilla server returned an error with http status: 400
Error details: [{'code': 'argilla.api.errors::MissingInputParamError', 'params': {'message': 'A workspace must be provided'}}]

Expected behavior Return dataset.

Environment:

Additional context loaded the initial dataset with the same package versions

dosubot[bot] commented 10 months ago

πŸ€–

Hello @maryc-sullivan! πŸš€

I'm Dosu, your friendly neighborhood bot, here to help you navigate through any bugs, questions, and steps to becoming a contributor. While we're waiting for a real human maintainer, consider me your first point of contact. Feel free to ask anything you need help with, and let's conquer this issue together! πŸ› οΈ

Oh, and did I mention? I'm a bot! πŸ€– Don't worry, I won't take it personally if you confuse me with a human, I get that a lot. πŸ˜„ Let's dive into your issue.

Based on the error message you're receiving, it seems like the rg.load() method is not recognizing the 'workspace' argument. This could be due to a couple of reasons:

  1. The workspace is not being correctly set or provided when trying to pull records from a TextClassification dataset. In the Argilla codebase, the function _prepare_workspace(client, workspace) is responsible for setting the workspace. If the workspace is not provided as an argument, it tries to get the workspace from the client. If it still can't find a workspace, it raises a ValueError with the message "No workspace provided and no active workspace found." You can find this in the source code.

  2. There might be a version mismatch issue. The latest version of Argilla is v1.21.0, but you're using Argilla[server]==1.2.1. It's possible that the 'workspace' argument was added in a later version.

To resolve this issue, you could try the following:

Also, I found a similar solved issue in the Argilla repository: [BUG] Workspace not found in rg.configure_dataset. This issue was closed by a pull request: fix: configure_dataset_settings to use workspace arg. It might be helpful to look at the changes made in this pull request.

I hope this helps! If you have any other questions or if the issue persists, please provide more details so I can assist you better.

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a πŸ‘ if this is helpful and πŸ‘Ž if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.