From 3b91292aa1e4771f1b9d8b2c9a7eb2ad8f676e03 Mon Sep 17 00:00:00 2001 From: Paco Aranda Date: Mon, 29 Jul 2024 13:57:29 +0200 Subject: [PATCH] chore: Update and align error message (#5319) # Description **Type of change** - Improvement (change adding some improvement to an existing functionality) **How Has This Been Tested** **Checklist** - I added relevant documentation - I followed the style guidelines of this project - I did a self-review of my code - I made corresponding changes to the documentation - I confirm My changes generate no new warnings - I have added tests that prove my fix is effective or that my feature works - I have added relevant notes to the CHANGELOG.md file (See https://keepachangelog.com/) --- argilla-frontend/translation/de.js | 4 ++++ argilla-frontend/translation/en.js | 2 +- argilla-server/src/argilla_server/validators/datasets.py | 2 +- .../unit/api/handlers/v1/datasets/test_update_dataset.py | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/argilla-frontend/translation/de.js b/argilla-frontend/translation/de.js index 0ef4ac053a..a7d1045dd0 100644 --- a/argilla-frontend/translation/de.js +++ b/argilla-frontend/translation/de.js @@ -224,6 +224,10 @@ export default { missing_vector: { message: "Vektor nicht im ausgewählten Datensatz gefunden", }, + update_distribution_with_existing_responses: { + message: + "Die Verteilungseinstellungen können für einen Datensatz mit Benutzerantworten nicht geändert werden", + }, }, http: { 401: { diff --git a/argilla-frontend/translation/en.js b/argilla-frontend/translation/en.js index d8fb47072f..db5b04e2b6 100644 --- a/argilla-frontend/translation/en.js +++ b/argilla-frontend/translation/en.js @@ -238,7 +238,7 @@ export default { }, update_distribution_with_existing_responses: { message: - "This dataset has responses. Task distribution settings cannot be modified", + "Distribution settings can't be modified for a dataset containing user responses", }, }, http: { diff --git a/argilla-server/src/argilla_server/validators/datasets.py b/argilla-server/src/argilla_server/validators/datasets.py index 0df3bc9bfa..490b909dbe 100644 --- a/argilla-server/src/argilla_server/validators/datasets.py +++ b/argilla-server/src/argilla_server/validators/datasets.py @@ -50,5 +50,5 @@ async def validate(cls, db: AsyncSession, dataset: Dataset, dataset_attrs: dict) async def _validate_distribution(cls, dataset: Dataset, dataset_attrs: dict) -> None: if dataset_attrs.get("distribution") is not None and (await dataset.responses_count) > 0: raise UpdateDistributionWithExistingResponsesError( - "Distribution settings cannot be modified for a dataset with records including responses" + "Distribution settings can't be modified for a dataset containing user responses" ) diff --git a/argilla-server/tests/unit/api/handlers/v1/datasets/test_update_dataset.py b/argilla-server/tests/unit/api/handlers/v1/datasets/test_update_dataset.py index bbba4b9140..a21bc4ad7d 100644 --- a/argilla-server/tests/unit/api/handlers/v1/datasets/test_update_dataset.py +++ b/argilla-server/tests/unit/api/handlers/v1/datasets/test_update_dataset.py @@ -142,7 +142,7 @@ async def test_update_dataset_distribution_for_dataset_with_responses( assert response.json() == { "code": "update_distribution_with_existing_responses", - "message": "Distribution settings cannot be modified for a dataset with records including responses", + "message": "Distribution settings can't be modified for a dataset containing user responses", } async def test_update_dataset_distribution_with_invalid_strategy(