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

Add delete and list methods for FeedbackDataset in Argilla via the Python client #3413

Closed
2 tasks
frascuchon opened this issue Jul 14, 2023 · 2 comments · Fixed by #3619 or CLARIN-PL/argilla#20
Closed
2 tasks
Assignees
Labels
type: enhancement Indicates new feature requests
Milestone

Comments

@frascuchon
Copy link
Member

frascuchon commented Jul 14, 2023

Since we can now delete workspaces, we need to tackle two main goals to improve this feature when datasets are linked to the workspace:

  • Support for removing a feedback dataset from the Python client
...
ds = FeedbackDataset.from_argilla(...)
ds.delete()
# or just (since the from_argilla will try to fetch all records locally
FeedbackDataset.delete(dataset_id)
  • Fetch the infor about which datasets are linked to the workspace

As a first approach, we could return the needed info as part of the delete error response. The name for "old" datasets, and the id for feedback ones

Listing and deleting old task datasets

import argilla as rg

ws = rg.Workspace.from_name("ws")

# listing old datasets for a workspace
datasets = rg.list_datasets(workspace=ws)
# or for all workspaces
datasets = rg.list_datasets()

# deleting old datasets
for dataset in datasets:
    rg.delete(name=dataset.name, workspace=datase.workspace)

Listing and deleting new feedback datasets

from argilla.feedback import FeedbackDataset

datasets = FeedbackDataset.list(workspace=ws)
# or all workspaces
datasets = FeedbackDataset.list()
for dataset in datasets:
    dataset.delete()
@frascuchon frascuchon added the type: enhancement Indicates new feature requests label Jul 14, 2023
@frascuchon frascuchon self-assigned this Jul 26, 2023
@alvarobartt alvarobartt changed the title Improve flow for workspace deletion from Python client Add FeedbackDataset deletion in Argilla from the Python client Aug 6, 2023
@alvarobartt
Copy link
Member

Now users can call delete() over an existing FeedbackDataset in Argilla, as well as deleting records from Argilla via delete_records or in-place deletion of records via record.delete().

But listing FeedbackDataset datasets is still pending, we just need to decide whether a list() method is the best approach to tackle it or not.

@alvarobartt alvarobartt changed the title Add FeedbackDataset deletion in Argilla from the Python client Add delete and list methods for FeedbackDataset in Argilla via the Python client Aug 10, 2023
@alvarobartt alvarobartt reopened this Aug 11, 2023
@alvarobartt
Copy link
Member

Re-opened, as the FeedbackDataset.list() method is still missing

alvarobartt added a commit that referenced this issue Aug 23, 2023
…3619)

# Description

This PR adds the class method `list` in `ArgillaMixin`, also renamed
from `ArgillaToFromMixin`. This way, users can call
`FeedbackDataset.list()` to list all the `FeedbackDataset` datasets in
Argilla.

Additionally, `list` includes the arg `workspace` so that users can also
specify the `workspace` that they want to list from, in case those are
assigned to more than one workspace.

Closes #3413
Mentioned #3521 #3591

**Type of change**

- [X] New feature (non-breaking change which adds functionality)

**How Has This Been Tested**

- [X] Add integration tests for `FeedbackDataset.list` (producing a list
of `RemoteFeedbackDataset`)

**Checklist**

- [X] I added relevant documentation
- [X] follows the style guidelines of this project
- [X] I did a self-review of my code
- [ ] I made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [X] I have added tests that prove my fix is effective or that my
feature works
- [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK)
(see text above)
- [x] I have added relevant notes to the CHANGELOG.md file (See
https://keepachangelog.com/)

---------

Co-authored-by: Gabriel Martín Blázquez <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@frascuchon frascuchon added this to the v1.15.0 milestone Aug 28, 2023
artikandri pushed a commit to CLARIN-PL/argilla that referenced this issue Oct 30, 2023
…#3512)

# Description

This PR adds a `delete` method for `RemoteFeedbackDataset` which is a
`FeedbackDataset` that has been pushed to Argilla. So on, the `delete`
method deletes a dataset in Argilla, but it's just available for `owner`
users and for `admin` users with that dataset within their workspace,
otherwise the method won't work and will raise a `PermissionError`.

So on, now both `owner` and `admin` users can delete a `FeedbackDataset`
from Argilla as:

```python
import argilla as rg

rg.init(...)

dataset = FeedbackDataset.from_argilla(...)
dataset.delete()
```

Or alternatively

```python
import argilla as rg

rg.init(...)

dataset = FeedbackDataset(...)
remote_dataset = dataset.push_to_argilla(...)
remote_dataset.delete()
```

Closes argilla-io#3413

**Type of change**

- [X] New feature (non-breaking change which adds functionality)

**How Has This Been Tested**

- [X] Add integration tests for `RemoteFeedbackDataset.delete` including
every role

**Checklist**

- [ ] I added relevant documentation
- [X] follows the style guidelines of this project
- [X] I did a self-review of my code
- [ ] I made corresponding changes to the documentation
- [X] My changes generate no new warnings
- [X] I have added tests that prove my fix is effective or that my
feature works
- [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK)
(see text above)
- [X] I have added relevant notes to the CHANGELOG.md file (See
https://keepachangelog.com/)
artikandri added a commit to CLARIN-PL/argilla that referenced this issue Oct 30, 2023
* chore: bump version to `1.14.0`

* chore: add `argilla-office-hours` Calendly link back

* fix: `push_to_argilla` to return `RemoteFeedbackDataset` without re-assigning class (argilla-io#3508)

# Description

This PR adds a `warnings.warn` message to let the users know that the
returned object from `FeedbackDataset.push_to_argilla` needs to be
handled, otherwise the dataset instance will remain local, as
`push_to_argilla` with no arguments won't do anything.

So on, before we had to `push_to_argilla` a new `FeedbackDataset` with
name and/or workspaces, and then we could `push_to_argilla` with no
arguments to push the updates, but we no longer need to do that, as now
we can re-use the returned `FeedbackDataset` from `push_to_argilla` to
have a `FeedbackDataset` fully integrated with Argilla.

```diff
import argilla as rg

dataset = rg.FeedbackDataset(...)
- dataset.push_to_argilla(name="my-dataset", workspace="my-workspace")
+ remote_dataset = dataset.push_to_argilla(name="my-dataset", workspace="my-workspace")

dataset.add_records(...)
- dataset.push_to_argilla()
```

**Type of change**

- [X] Bug fix (non-breaking change which fixes an issue)
- [X] Breaking change (fix or feature that would cause existing
functionality to not work as expected)

**How Has This Been Tested**

- [X] Catch returned object in `push_to_argilla` and handle
`DeprecationWarning`

**Checklist**

- [ ] I added relevant documentation
- [X] follows the style guidelines of this project
- [X] I did a self-review of my code
- [ ] I made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [X] I have added tests that prove my fix is effective or that my
feature works
- [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK)
(see text above)
- [ ] I have added relevant notes to the CHANGELOG.md file (See
https://keepachangelog.com/)

---------

Co-authored-by: Gabriel Martín Blázquez <[email protected]>

* feat: add `delete` method to `FeedbackDataset` in Argilla (argilla-io#3512)

# Description

This PR adds a `delete` method for `RemoteFeedbackDataset` which is a
`FeedbackDataset` that has been pushed to Argilla. So on, the `delete`
method deletes a dataset in Argilla, but it's just available for `owner`
users and for `admin` users with that dataset within their workspace,
otherwise the method won't work and will raise a `PermissionError`.

So on, now both `owner` and `admin` users can delete a `FeedbackDataset`
from Argilla as:

```python
import argilla as rg

rg.init(...)

dataset = FeedbackDataset.from_argilla(...)
dataset.delete()
```

Or alternatively

```python
import argilla as rg

rg.init(...)

dataset = FeedbackDataset(...)
remote_dataset = dataset.push_to_argilla(...)
remote_dataset.delete()
```

Closes argilla-io#3413

**Type of change**

- [X] New feature (non-breaking change which adds functionality)

**How Has This Been Tested**

- [X] Add integration tests for `RemoteFeedbackDataset.delete` including
every role

**Checklist**

- [ ] I added relevant documentation
- [X] follows the style guidelines of this project
- [X] I did a self-review of my code
- [ ] I made corresponding changes to the documentation
- [X] My changes generate no new warnings
- [X] I have added tests that prove my fix is effective or that my
feature works
- [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK)
(see text above)
- [X] I have added relevant notes to the CHANGELOG.md file (See
https://keepachangelog.com/)

* fix: `publish_dataset` to check `required=True` on at least one field/question (argilla-io#3511)

# Description

This PR fixes a bug with the `PUT /api/v1/datasets/{dataset_id}/publish`
endpoint, as there was a missing check on the `required` flag for each
field/question which was allowing to publish `FeedbackTask` datasets
with no required fields and/or questions.

**Type of change**

- [X] Bug fix (non-breaking change which fixes an issue)

**How Has This Been Tested**

- [X] Update existing unit/integration tests
- [X] Add unit/integration tests with `required=True` and
`required=False`

**Checklist**

- [ ] I added relevant documentation
- [X] follows the style guidelines of this project
- [X] I did a self-review of my code
- [ ] I made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [X] I have added tests that prove my fix is effective or that my
feature works
- [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK)
(see text above)
- [ ] I have added relevant notes to the CHANGELOG.md file (See
https://keepachangelog.com/)

---------

Co-authored-by: Gabriel Martin <[email protected]>

* docs: fix link to ASGI middleware tutorial (argilla-io#3518)

# Description

Fix broken link to ASGI middleware tutorial.

**Type of change**

- [x] Documentation update

**How Has This Been Tested**

N/A

**Checklist**

- [ ] I added relevant documentation
- [x] follows the style guidelines of this project
- [x] I did a self-review of my code
- [ ] I made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK)
(see text above)
- [ ] I have added relevant notes to the CHANGELOG.md file (See
https://keepachangelog.com/)

* fix: `thread_ts` is not always present (argilla-io#3538)

# Description

The `slack-post-credentials` action is failing from time to time because
not all the messages have the `thread_ts` key. This PR fixes this issue
using the `ts` key instead of the `thread_ts`.

**Type of change**

- [x] Bug fix (non-breaking change which fixes an issue)

**How Has This Been Tested**

(Please describe the tests that you ran to verify your changes. And
ideally, reference `tests`)

The deployment job got executed fine for this PR:
https://github.com/argilla-io/argilla/actions/runs/5818199084/job/15774977297?pr=3538

**Checklist**

- [x] I followed the style guidelines of this project
- [x] I did a self-review of my code
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK)
(see text above)
- [ ] I have added relevant notes to the `CHANGELOG.md` file (See
https://keepachangelog.com/)

* fix: restore `suggestions` and `responses` as rows in `HuggingFaceDatasetMixin` (argilla-io#3539)

# Description

This PR addresses the feature mentioned by @tomaarsen at
argilla-io#3467, to basically export the
`responses` for the existing questions in the `FeedbackDataset` when
calling `push_to_huggingface` in a row-based format instead of using the
`Sequence` from 🤗`datasets`. This makes the dataset from the HuggingFace
Hub more readable, and also easier to use with other frameworks and/or
libraries.

```diff
- {"user_id": ["A", "B"], "value": [1, 2], "status": ["C", "D"]}
+ [{"user_id": "A", "value": 1, "status": "C"}, {"user_id": "B", "value": 2, "status": "D"}]
```

Additionally, this PR also ensure that the backwards compatibility is
preserved with the previous versions, and assumes the new format as the
default one when calling `format_as("datasets")`.

Finally, this PR also solves an issue reported by @nataliaElv recently
that was affecting the `suggestions` when calling
`FeedbackDataset.from_argilla`, as those were just kept when there were
`responses`, otherwise, a `continue` statement was being called so the
`suggestions` were completely ignored.

**Type of change**

- [X] Bug fix (non-breaking change which fixes an issue)
- [X] New feature (non-breaking change which adds functionality)

**How Has This Been Tested**

(Please describe the tests that you ran to verify your changes. And
ideally, reference `tests`)

- [X] Ran the following script and tested different combinations as the
connection to HuggingFace is mocked, but we should create a fake/testing
user at some point to avoid overloading `argilla-io`

```python
import argilla as rg

dataset = rg.FeedbackDataset(
    fields=[
        rg.TextField(
            name="prompt",
            required=True,
        ),
    ],
    questions=[
        rg.TextQuestion(
            name="response-edit",
            title="Add or edit the response if necessary",
            required=True,
        ),
    ],
)
dataset.add_records(
    rg.FeedbackRecord(
        fields={
            "prompt": "This is the prompt!",
        },
        suggestions=[
            {
                "question_name": "response-edit",
                "value": "This is the suggestion!"
            }
        ],
    )
)
dataset.push_to_huggingface("<REPO_ID>")
dataset = rg.FeedbackDataset.from_huggingface("<REPO_ID>")
assert dataset.records[0].suggestions is not None
```

**Checklist**

- [ ] I added relevant documentation
- [X] follows the style guidelines of this project
- [X] I did a self-review of my code
- [ ] I made corresponding changes to the documentation
- [X] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK)
(see text above)
- [X] I have added relevant notes to the CHANGELOG.md file (See
https://keepachangelog.com/)

---------

Co-authored-by: Gabriel Martin <[email protected]>

* docs: Update dataset page (argilla-io#3535)

<!-- Thanks for your contribution! As part of our Community Growers
initiative 🌱, we're donating Justdiggit bunds in your name to reforest
sub-Saharan Africa. To claim your Community Growers certificate, please
contact David Berenstein in our Slack community or fill in this form
https://tally.so/r/n9XrxK once your PR has been merged. -->

# Description

New page to showcase different workflows to update and make changes to
an existing Argilla dataset.

Closes argilla-io#3534

**Type of change**

(Remember to title the PR according to the type of change)

- [x] Documentation update

**How Has This Been Tested**

(Please describe the tests that you ran to verify your changes.)

- [x] `sphinx-autobuild` (read [Developer
Documentation](https://docs.argilla.io/en/latest/community/developer_docs.html#building-the-documentation)
for more details)

**Checklist**

- [ ] I added relevant documentation
- [x] I followed the style guidelines of this project
- [x] I did a self-review of my code
- [x] I made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK)
(see text above)
- [x] I have added relevant notes to the `CHANGELOG.md` file (See
https://keepachangelog.com/)

---------

Co-authored-by: Alvaro Bartolome <[email protected]>

* docs: align docs with `FeedbackDataset` refactor using `tab-set`  (argilla-io#3531)

This PR adds the `tab-set` for the outdated code-blocks with the
upcoming release of Argilla v1.14.0 so as to showcase both the previous
and the new code-blocks for users that are still using Argilla v1.14.0
or lower.

Additionally, the style has been fixed in some documents while reviewing
the outdated code-blocks, some file paths references have been fixed to
point to the HTML files via relative paths, and some minor details.

Finally, a `warning` has also been included to let the users know that
Argilla v1.14.0 won't work for the moment with the
`ArgillaCallbackHandler` in `LangChain`.

**Type of change**

- [X] Documentation update

---------

Co-authored-by: Gabriel Martín Blázquez <[email protected]>
Co-authored-by: Natalia Elvira <[email protected]>

* fix: Argilla not working behind proxy (argilla-io#3543)

# Description

This PR updates the URL in which the Argilla App is mounted to be `"/"`,
as it's not required to change the URL of the server because the proxy
will know what rewrite has to be done.

In addition, the entrypoint scripts of both images have been updated to
add the `--root-path $ARGILLA_BASE_URL` option to the `uvicorn` command
if `ARGILLA_BASE_URL` env variable has been set. More info: [FastAPI -
Behind a
proxy](https://fastapi.tiangolo.com/advanced/behind-a-proxy/#behind-a-proxy).

Closes argilla-io#3542

**Type of change**

- [x] Bug fix (non-breaking change which fixes an issue)

**How Has This Been Tested**

- [x] `localhost/argilla` load in a web browser and can connect using
`rg.init` with an NGINX local setup:
  <details>
    <summary>Local Nginx</summary>
  
  `docker-compose.yaml`:
  
    ```yaml
  version: '3.8'
  
  services:
    argilla:
      image: argilla/argilla-quickstart:pr-3543
      environment:
        ARGILLA_BASE_URL: /argilla
        LOAD_DATASETS: none
      ports:
        - 6900:6900
  
    nginx:
      image: nginx:latest
      ports:
        - 80:80
      volumes:
        - ./nginx.conf:/etc/nginx/nginx.conf
    ```
    `nginx.conf`:
    ```
  events {}
  
  http {
    server {
        listen 80;
  
        server_name your_server_name_or_ip;
  
        location /argilla/ {
            proxy_pass http://argilla:6900/;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
        }
    }
  }
    ```
  </details>

**Checklist**

- [x] I followed the style guidelines of this project
- [x] I did a self-review of my code
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK)
(see text above)
- [x] I have added relevant notes to the `CHANGELOG.md` file (See
https://keepachangelog.com/)

* fix: execute build docker only if build python (argilla-io#3547)

# Description

This PR updates the `package.yaml` workflow to **only** execute the
`build_server_docker_image` job if the `build_python_package` has been
executed and it's execution has succeeded (as the first job needs the
python package artifact generated by the second one)

Closes argilla-io#3544

**Type of change**

- [x] Bug fix (non-breaking change which fixes an issue)

**How Has This Been Tested**

N/A

**Checklist**

- [x] I followed the style guidelines of this project
- [x] I did a self-review of my code
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK)
(see text above)
- [ ] I have added relevant notes to the `CHANGELOG.md` file (See
https://keepachangelog.com/)

* chore: bump frontend version to `1.14.0`

* fix: `{FieldSchema, QuestionSchema}.name` attribute didn't have regex validation (argilla-io#3550)

# Description

This PR adds the regex validation to the `{FieldSchema,
QuestionSchema}.name` attribute. This regex validation is already
present in the server side, adding it to the client will allow to raise
a `ValidationError` before calling the server.

Closes argilla-io#3548

**Type of change**

- [x] Bug fix (non-breaking change which fixes an issue)

**How Has This Been Tested**

Added new unit tests covering the described issue above.

**Checklist**

- [x] I followed the style guidelines of this project
- [x] I did a self-review of my code
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK)
(see text above)
- [x] I have added relevant notes to the `CHANGELOG.md` file (See
https://keepachangelog.com/)

---------

Co-authored-by: Alvaro Bartolome <[email protected]>

---------

Co-authored-by: gabrielmbmb <[email protected]>
Co-authored-by: Alvaro Bartolome <[email protected]>
Co-authored-by: Gabriel Martin <[email protected]>
Co-authored-by: Natalia Elvira <[email protected]>
Co-authored-by: Natalia Elvira <[email protected]>
artikandri added a commit to CLARIN-PL/argilla that referenced this issue Oct 31, 2023
* chore: bump version to `1.14.0`

* chore: add `argilla-office-hours` Calendly link back

* fix: `push_to_argilla` to return `RemoteFeedbackDataset` without re-assigning class (argilla-io#3508)

# Description

This PR adds a `warnings.warn` message to let the users know that the
returned object from `FeedbackDataset.push_to_argilla` needs to be
handled, otherwise the dataset instance will remain local, as
`push_to_argilla` with no arguments won't do anything.

So on, before we had to `push_to_argilla` a new `FeedbackDataset` with
name and/or workspaces, and then we could `push_to_argilla` with no
arguments to push the updates, but we no longer need to do that, as now
we can re-use the returned `FeedbackDataset` from `push_to_argilla` to
have a `FeedbackDataset` fully integrated with Argilla.

```diff
import argilla as rg

dataset = rg.FeedbackDataset(...)
- dataset.push_to_argilla(name="my-dataset", workspace="my-workspace")
+ remote_dataset = dataset.push_to_argilla(name="my-dataset", workspace="my-workspace")

dataset.add_records(...)
- dataset.push_to_argilla()
```

**Type of change**

- [X] Bug fix (non-breaking change which fixes an issue)
- [X] Breaking change (fix or feature that would cause existing
functionality to not work as expected)

**How Has This Been Tested**

- [X] Catch returned object in `push_to_argilla` and handle
`DeprecationWarning`

**Checklist**

- [ ] I added relevant documentation
- [X] follows the style guidelines of this project
- [X] I did a self-review of my code
- [ ] I made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [X] I have added tests that prove my fix is effective or that my
feature works
- [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK)
(see text above)
- [ ] I have added relevant notes to the CHANGELOG.md file (See
https://keepachangelog.com/)

---------



* feat: add `delete` method to `FeedbackDataset` in Argilla (argilla-io#3512)

# Description

This PR adds a `delete` method for `RemoteFeedbackDataset` which is a
`FeedbackDataset` that has been pushed to Argilla. So on, the `delete`
method deletes a dataset in Argilla, but it's just available for `owner`
users and for `admin` users with that dataset within their workspace,
otherwise the method won't work and will raise a `PermissionError`.

So on, now both `owner` and `admin` users can delete a `FeedbackDataset`
from Argilla as:

```python
import argilla as rg

rg.init(...)

dataset = FeedbackDataset.from_argilla(...)
dataset.delete()
```

Or alternatively

```python
import argilla as rg

rg.init(...)

dataset = FeedbackDataset(...)
remote_dataset = dataset.push_to_argilla(...)
remote_dataset.delete()
```

Closes argilla-io#3413

**Type of change**

- [X] New feature (non-breaking change which adds functionality)

**How Has This Been Tested**

- [X] Add integration tests for `RemoteFeedbackDataset.delete` including
every role

**Checklist**

- [ ] I added relevant documentation
- [X] follows the style guidelines of this project
- [X] I did a self-review of my code
- [ ] I made corresponding changes to the documentation
- [X] My changes generate no new warnings
- [X] I have added tests that prove my fix is effective or that my
feature works
- [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK)
(see text above)
- [X] I have added relevant notes to the CHANGELOG.md file (See
https://keepachangelog.com/)

* fix: `publish_dataset` to check `required=True` on at least one field/question (argilla-io#3511)

# Description

This PR fixes a bug with the `PUT /api/v1/datasets/{dataset_id}/publish`
endpoint, as there was a missing check on the `required` flag for each
field/question which was allowing to publish `FeedbackTask` datasets
with no required fields and/or questions.

**Type of change**

- [X] Bug fix (non-breaking change which fixes an issue)

**How Has This Been Tested**

- [X] Update existing unit/integration tests
- [X] Add unit/integration tests with `required=True` and
`required=False`

**Checklist**

- [ ] I added relevant documentation
- [X] follows the style guidelines of this project
- [X] I did a self-review of my code
- [ ] I made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [X] I have added tests that prove my fix is effective or that my
feature works
- [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK)
(see text above)
- [ ] I have added relevant notes to the CHANGELOG.md file (See
https://keepachangelog.com/)

---------



* docs: fix link to ASGI middleware tutorial (argilla-io#3518)

# Description

Fix broken link to ASGI middleware tutorial.

**Type of change**

- [x] Documentation update

**How Has This Been Tested**

N/A

**Checklist**

- [ ] I added relevant documentation
- [x] follows the style guidelines of this project
- [x] I did a self-review of my code
- [ ] I made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK)
(see text above)
- [ ] I have added relevant notes to the CHANGELOG.md file (See
https://keepachangelog.com/)

* fix: `thread_ts` is not always present (argilla-io#3538)

# Description

The `slack-post-credentials` action is failing from time to time because
not all the messages have the `thread_ts` key. This PR fixes this issue
using the `ts` key instead of the `thread_ts`.

**Type of change**

- [x] Bug fix (non-breaking change which fixes an issue)

**How Has This Been Tested**

(Please describe the tests that you ran to verify your changes. And
ideally, reference `tests`)

The deployment job got executed fine for this PR:
https://github.com/argilla-io/argilla/actions/runs/5818199084/job/15774977297?pr=3538

**Checklist**

- [x] I followed the style guidelines of this project
- [x] I did a self-review of my code
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK)
(see text above)
- [ ] I have added relevant notes to the `CHANGELOG.md` file (See
https://keepachangelog.com/)

* fix: restore `suggestions` and `responses` as rows in `HuggingFaceDatasetMixin` (argilla-io#3539)

# Description

This PR addresses the feature mentioned by @tomaarsen at
argilla-io#3467, to basically export the
`responses` for the existing questions in the `FeedbackDataset` when
calling `push_to_huggingface` in a row-based format instead of using the
`Sequence` from 🤗`datasets`. This makes the dataset from the HuggingFace
Hub more readable, and also easier to use with other frameworks and/or
libraries.

```diff
- {"user_id": ["A", "B"], "value": [1, 2], "status": ["C", "D"]}
+ [{"user_id": "A", "value": 1, "status": "C"}, {"user_id": "B", "value": 2, "status": "D"}]
```

Additionally, this PR also ensure that the backwards compatibility is
preserved with the previous versions, and assumes the new format as the
default one when calling `format_as("datasets")`.

Finally, this PR also solves an issue reported by @nataliaElv recently
that was affecting the `suggestions` when calling
`FeedbackDataset.from_argilla`, as those were just kept when there were
`responses`, otherwise, a `continue` statement was being called so the
`suggestions` were completely ignored.

**Type of change**

- [X] Bug fix (non-breaking change which fixes an issue)
- [X] New feature (non-breaking change which adds functionality)

**How Has This Been Tested**

(Please describe the tests that you ran to verify your changes. And
ideally, reference `tests`)

- [X] Ran the following script and tested different combinations as the
connection to HuggingFace is mocked, but we should create a fake/testing
user at some point to avoid overloading `argilla-io`

```python
import argilla as rg

dataset = rg.FeedbackDataset(
    fields=[
        rg.TextField(
            name="prompt",
            required=True,
        ),
    ],
    questions=[
        rg.TextQuestion(
            name="response-edit",
            title="Add or edit the response if necessary",
            required=True,
        ),
    ],
)
dataset.add_records(
    rg.FeedbackRecord(
        fields={
            "prompt": "This is the prompt!",
        },
        suggestions=[
            {
                "question_name": "response-edit",
                "value": "This is the suggestion!"
            }
        ],
    )
)
dataset.push_to_huggingface("<REPO_ID>")
dataset = rg.FeedbackDataset.from_huggingface("<REPO_ID>")
assert dataset.records[0].suggestions is not None
```

**Checklist**

- [ ] I added relevant documentation
- [X] follows the style guidelines of this project
- [X] I did a self-review of my code
- [ ] I made corresponding changes to the documentation
- [X] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK)
(see text above)
- [X] I have added relevant notes to the CHANGELOG.md file (See
https://keepachangelog.com/)

---------



* docs: Update dataset page (argilla-io#3535)

<!-- Thanks for your contribution! As part of our Community Growers
initiative 🌱, we're donating Justdiggit bunds in your name to reforest
sub-Saharan Africa. To claim your Community Growers certificate, please
contact David Berenstein in our Slack community or fill in this form
https://tally.so/r/n9XrxK once your PR has been merged. -->

# Description

New page to showcase different workflows to update and make changes to
an existing Argilla dataset.

Closes argilla-io#3534

**Type of change**

(Remember to title the PR according to the type of change)

- [x] Documentation update

**How Has This Been Tested**

(Please describe the tests that you ran to verify your changes.)

- [x] `sphinx-autobuild` (read [Developer
Documentation](https://docs.argilla.io/en/latest/community/developer_docs.html#building-the-documentation)
for more details)

**Checklist**

- [ ] I added relevant documentation
- [x] I followed the style guidelines of this project
- [x] I did a self-review of my code
- [x] I made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK)
(see text above)
- [x] I have added relevant notes to the `CHANGELOG.md` file (See
https://keepachangelog.com/)

---------



* docs: align docs with `FeedbackDataset` refactor using `tab-set`  (argilla-io#3531)

This PR adds the `tab-set` for the outdated code-blocks with the
upcoming release of Argilla v1.14.0 so as to showcase both the previous
and the new code-blocks for users that are still using Argilla v1.14.0
or lower.

Additionally, the style has been fixed in some documents while reviewing
the outdated code-blocks, some file paths references have been fixed to
point to the HTML files via relative paths, and some minor details.

Finally, a `warning` has also been included to let the users know that
Argilla v1.14.0 won't work for the moment with the
`ArgillaCallbackHandler` in `LangChain`.

**Type of change**

- [X] Documentation update

---------




* fix: Argilla not working behind proxy (argilla-io#3543)

# Description

This PR updates the URL in which the Argilla App is mounted to be `"/"`,
as it's not required to change the URL of the server because the proxy
will know what rewrite has to be done.

In addition, the entrypoint scripts of both images have been updated to
add the `--root-path $ARGILLA_BASE_URL` option to the `uvicorn` command
if `ARGILLA_BASE_URL` env variable has been set. More info: [FastAPI -
Behind a
proxy](https://fastapi.tiangolo.com/advanced/behind-a-proxy/#behind-a-proxy).

Closes argilla-io#3542

**Type of change**

- [x] Bug fix (non-breaking change which fixes an issue)

**How Has This Been Tested**

- [x] `localhost/argilla` load in a web browser and can connect using
`rg.init` with an NGINX local setup:
  <details>
    <summary>Local Nginx</summary>
  
  `docker-compose.yaml`:
  
    ```yaml
  version: '3.8'
  
  services:
    argilla:
      image: argilla/argilla-quickstart:pr-3543
      environment:
        ARGILLA_BASE_URL: /argilla
        LOAD_DATASETS: none
      ports:
        - 6900:6900
  
    nginx:
      image: nginx:latest
      ports:
        - 80:80
      volumes:
        - ./nginx.conf:/etc/nginx/nginx.conf
    ```
    `nginx.conf`:
    ```
  events {}
  
  http {
    server {
        listen 80;
  
        server_name your_server_name_or_ip;
  
        location /argilla/ {
            proxy_pass http://argilla:6900/;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
        }
    }
  }
    ```
  </details>

**Checklist**

- [x] I followed the style guidelines of this project
- [x] I did a self-review of my code
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK)
(see text above)
- [x] I have added relevant notes to the `CHANGELOG.md` file (See
https://keepachangelog.com/)

* fix: execute build docker only if build python (argilla-io#3547)

# Description

This PR updates the `package.yaml` workflow to **only** execute the
`build_server_docker_image` job if the `build_python_package` has been
executed and it's execution has succeeded (as the first job needs the
python package artifact generated by the second one)

Closes argilla-io#3544

**Type of change**

- [x] Bug fix (non-breaking change which fixes an issue)

**How Has This Been Tested**

N/A

**Checklist**

- [x] I followed the style guidelines of this project
- [x] I did a self-review of my code
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK)
(see text above)
- [ ] I have added relevant notes to the `CHANGELOG.md` file (See
https://keepachangelog.com/)

* chore: bump frontend version to `1.14.0`

* fix: `{FieldSchema, QuestionSchema}.name` attribute didn't have regex validation (argilla-io#3550)

# Description

This PR adds the regex validation to the `{FieldSchema,
QuestionSchema}.name` attribute. This regex validation is already
present in the server side, adding it to the client will allow to raise
a `ValidationError` before calling the server.

Closes argilla-io#3548

**Type of change**

- [x] Bug fix (non-breaking change which fixes an issue)

**How Has This Been Tested**

Added new unit tests covering the described issue above.

**Checklist**

- [x] I followed the style guidelines of this project
- [x] I did a self-review of my code
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK)
(see text above)
- [x] I have added relevant notes to the `CHANGELOG.md` file (See
https://keepachangelog.com/)

---------



---------

Co-authored-by: gabrielmbmb <[email protected]>
Co-authored-by: Alvaro Bartolome <[email protected]>
Co-authored-by: Gabriel Martin <[email protected]>
Co-authored-by: Natalia Elvira <[email protected]>
Co-authored-by: Natalia Elvira <[email protected]>
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
3 participants