argilla-io / argilla

Argilla is a collaboration platform for AI engineers and domain experts that require high-quality outputs, full data ownership, and overall efficiency.
https://docs.argilla.io/en/latest/
3.63k stars 339 forks source link

[BUG-python/deployment-v1] remote `update_records` only works after changing `post` to `patch` #5110

Open davidberenstein1957 opened 5 days ago

davidberenstein1957 commented 5 days ago

Describe the bug

Hi, I was speaking to Aleph Alpha and they seemed to have issues with this. I don't know all of the context but it seems like a bug we might need to explore.

Stacktrace and Code to create the bug

N.A.

Expected behavior

I would expect it to work

Environment:

Additional context

NiklasKoehneckeAA commented 5 days ago

Describe the bug

Attempting to update records in a RemoteFeedbackDataset appears to not update the records.

Stacktrace and Code to create the bug

import argilla as rg

dataset = rg.FeedbackDataset(fields=[rg.TextField(name="field")], questions=[rg.RatingQuestion(name="question", values=[1,2])])
dataset.push_to_argilla("myname", show_progress=False)
remote_dataset = rg.FeedbackDataset.from_argilla("myname")
# create records
records = [rg.FeedbackRecord(fields={"field": "1"})]
remote_dataset.add_records(records, show_progress=False)

# broken code
modified_records = []
for record in remote_dataset.records:
    record.fields = {"field": 2}
    modified_records.append(record)
remote_dataset.update_records(modified_records, show_progress=False)

# show no update
for record in remote_dataset.records:
    print(record.fields)

Outputs the following info logs:

{'field': '1'}

The server shows the following request:

"PATCH /api/v1/datasets/4094f47e-137e-403e-83f3-66b330ca8304/records HTTP/1.1" 204 No Content

Expected behavior Expected the field to be 2. This is not only limited to the fields, but also did not work when trying to update the responses. Manually calling post on the records works.

Environment: python: 3.12 Argilla Version: argilla==1.29.0 ElasticSearch Version [e.g. 7.10.2]: docker.elastic.co/elasticsearch/elasticsearch:8.5.3 Docker Image (optional) [e.g. argilla:v1.0.0]: argilla/argilla-server:v1.29.0