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

[BUGFIX] argilla: allow change default distribution values #5719

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions argilla/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions argilla/src/argilla/settings/_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
8 changes: 8 additions & 0 deletions argilla/tests/unit/test_settings/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down