diff --git a/argilla/CHANGELOG.md b/argilla/CHANGELOG.md index 620ed69018..3684e9c15b 100644 --- a/argilla/CHANGELOG.md +++ b/argilla/CHANGELOG.md @@ -25,6 +25,10 @@ These are the section headers that we use: - Added support to webhook listeners. ([#5502](https://github.com/argilla-io/argilla/pull/5502)) - Added support to Python 3.13. ([#5652](https://github.com/argilla-io/argilla/pull/5652)) +### Fixed + +- Fixed error when update settings.distribution.min_submitted from defaults ([#5719](https://github.com/argilla-io/argilla/pull/5719)) + ## [2.4.0](https://github.com/argilla-io/argilla/compare/v2.3.0...v2.4.0) ### Added diff --git a/argilla/src/argilla/settings/_resource.py b/argilla/src/argilla/settings/_resource.py index 6971db722f..e750a66de1 100644 --- a/argilla/src/argilla/settings/_resource.py +++ b/argilla/src/argilla/settings/_resource.py @@ -73,7 +73,7 @@ def __init__( super().__init__(client=_dataset._client if _dataset else None) self._dataset = _dataset - self._distribution = distribution + self._distribution = distribution or TaskDistribution.default() self._mapping = mapping self.__guidelines = self.__process_guidelines(guidelines) self.__allow_extra_metadata = allow_extra_metadata @@ -137,7 +137,7 @@ def allow_extra_metadata(self, value: bool): @property def distribution(self) -> TaskDistribution: - return self._distribution or TaskDistribution.default() + return self._distribution @distribution.setter def distribution(self, value: TaskDistribution) -> None: diff --git a/argilla/tests/unit/test_settings/test_settings.py b/argilla/tests/unit/test_settings/test_settings.py index 73f69883b9..30ba3ea6a2 100644 --- a/argilla/tests/unit/test_settings/test_settings.py +++ b/argilla/tests/unit/test_settings/test_settings.py @@ -176,6 +176,14 @@ def test_settings_with_modified_default_task_distribution(self): other_settings = rg.Settings(fields=[rg.TextField(name="text", title="title")]) assert other_settings.distribution == TaskDistribution(min_submitted=1) + def test_settings_with_modified_task_distribution_value(self): + settings = rg.Settings(fields=[rg.TextField(name="text", title="title")]) + + assert settings.distribution == TaskDistribution(min_submitted=1) + settings.distribution.min_submitted = 10 + + assert settings.distribution == TaskDistribution(min_submitted=10) + def test_compare_equal_settings(self): settings = rg.Settings(fields=[rg.TextField(name="text", title="title")]) assert settings == settings