Skip to content

Commit

Permalink
Merge branch 'releases/2.3.0' into docs/custom-field
Browse files Browse the repository at this point in the history
  • Loading branch information
frascuchon authored Oct 3, 2024
2 parents 9cb02de + 0b4683b commit ce88cee
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 7 deletions.
1 change: 1 addition & 0 deletions argilla-server/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ These are the section headers that we use:
### Fixed

- Fixed error when creating default user with existing default workspace. ([#5558](https://github.com/argilla-io/argilla/pull/5558))
- Fixed the deployment yaml used to create a new Argilla server in K8s. Added `USERNAME` and `PASSWORD` to the environment variables of pod template. ([#5434](https://github.com/argilla-io/argilla/issues/5434))

## [2.2.0](https://github.com/argilla-io/argilla/compare/v2.1.0...v2.2.0)

Expand Down
6 changes: 3 additions & 3 deletions argilla/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ These are the section headers that we use:
- Added support for `CustomField`. ([#5422](https://github.com/argilla-io/argilla/pull/5422))
- Added `inserted_at` and `updated_at` to `Resource` model as properties. ([#5540](https://github.com/argilla-io/argilla/pull/5540))
- Added `limit` argument when fetching records. ([#5525](https://github.com/argilla-io/argilla/pull/5525)
- Added similarity search support. ((#5546)[https://github.com/argilla-io/argilla/pull/5546])
- Added similarity search support. ([#5546](https://github.com/argilla-io/argilla/pull/5546))
- Added filter support for `id`, `_server_id`, `inserted_at` and `updated_at` record attributes. ([#5545](https://github.com/argilla-io/argilla/pull/5545))
- Added support to read argilla credentials from colab secrets. ([#5541](https://github.com/argilla-io/argilla/pull/5541)))

### Changed

- Changed the __repr__ method for `SettingsProperties` to display the details of all the properties in `Setting` object. ([#5380](https://github.com/argilla-io/argilla/issues/5380))
- Changed error messages when creating datasets with insufficient permissions. ([#5540](https://github.com/argilla-io/argilla/pull/5554))
-

### Fixed

- Fixed the deployment yaml used to create a new Argilla server in K8s. Added `USERNAME` and `PASSWORD` to the environment variables of pod template. ([#5434](https://github.com/argilla-io/argilla/issues/5434))
- Fixed serialization of `ChatField` when collecting records from the hub and exporting to `datasets`. ([#5554](https://github.com/argilla-io/argilla/pull/5553))

## [2.2.2](https://github.com/argilla-io/argilla/compare/v2.2.1...v2.2.2)
Expand Down
3 changes: 3 additions & 0 deletions argilla/src/argilla/settings/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ def description(self, value: str):
def type(self) -> str:
return self._model.settings.type

def validate(self):
pass

def serialize(self) -> dict[str, Any]:
serialized_model = super().serialize()
serialized_model["type"] = self.type
Expand Down
14 changes: 10 additions & 4 deletions argilla/src/argilla/settings/_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from abc import ABC
import os
import requests
from abc import ABC
from typing import Optional, Union, TYPE_CHECKING

import requests

from argilla import Argilla
from argilla._api import FieldsAPI
from argilla._exceptions import ArgillaError
from argilla._exceptions import ArgillaError, SettingsError
from argilla._models import (
FieldModel,
TextFieldSettings,
Expand Down Expand Up @@ -261,7 +262,12 @@ def advanced_mode(self) -> Optional[bool]:
def advanced_mode(self, value: bool) -> None:
self._model.settings.advanced_mode = value

def _load_template(self, template: str) -> str:
def validate(self):
if self.template is None or self.template.strip() == "":
raise SettingsError("A valid template is required for CustomField")

@classmethod
def _load_template(cls, template: str) -> str:
if template.endswith(".html") and os.path.exists(template):
with open(template, "r") as f:
return f.read()
Expand Down
3 changes: 3 additions & 0 deletions argilla/src/argilla/settings/_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ def validate(self) -> None:
self._validate_empty_settings()
self._validate_duplicate_names()

for field in self.fields:
field.validate()

#####################
# Public methods #
#####################
Expand Down

0 comments on commit ce88cee

Please sign in to comment.