Skip to content

Commit 1ec0feb

Browse files
authored
[BUGFIX] remove name as default description in settings models (#5081)
This change adapt the base settings model so that name is not used as a default description for questions. - Bug fix (non-breaking change which fixes an issue) **How Has This Been Tested** <!-- Please add some reference about how your feature has been tested. --> **Checklist** <!-- Please go over the list and make sure you've taken everything into account --> - I added relevant documentation - follows 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/) Co-authored-by: Ben Burtenshaw <[email protected]>
1 parent c6df634 commit 1ec0feb

File tree

1 file changed

+1
-7
lines changed
  • argilla/src/argilla/_models/_settings/_questions

1 file changed

+1
-7
lines changed

argilla/src/argilla/_models/_settings/_questions/_base.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class QuestionBaseModel(BaseModel, validate_assignment=True):
3030
settings: QuestionSettings
3131

3232
title: str = Field(None, validate_default=True)
33-
description: Optional[str] = Field(None, validate_default=True)
33+
description: Optional[str] = None
3434
required: bool = True
3535
inserted_at: Optional[datetime] = None
3636
updated_at: Optional[datetime] = None
@@ -47,12 +47,6 @@ def __title_default(cls, title, info: ValidationInfo):
4747
validated_title = title or info.data["name"]
4848
return validated_title
4949

50-
@field_validator("description")
51-
@classmethod
52-
def __description_default(cls, description, info: ValidationInfo) -> Optional[str]:
53-
data = info.data
54-
return description or data["title"]
55-
5650
@field_serializer("inserted_at", "updated_at", when_used="unless-none")
5751
def serialize_datetime(self, value: datetime) -> str:
5852
return value.isoformat()

0 commit comments

Comments
 (0)