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] remove name as default description in settings models #5081

Merged
merged 1 commit into from
Jun 28, 2024
Merged
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
8 changes: 1 addition & 7 deletions argilla/src/argilla/_models/_settings/_questions/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class QuestionBaseModel(BaseModel, validate_assignment=True):
settings: QuestionSettings

title: str = Field(None, validate_default=True)
description: Optional[str] = Field(None, validate_default=True)
description: Optional[str] = None
required: bool = True
inserted_at: Optional[datetime] = None
updated_at: Optional[datetime] = None
Expand All @@ -47,12 +47,6 @@ def __title_default(cls, title, info: ValidationInfo):
validated_title = title or info.data["name"]
return validated_title

@field_validator("description")
@classmethod
def __description_default(cls, description, info: ValidationInfo) -> Optional[str]:
data = info.data
return description or data["title"]

@field_serializer("inserted_at", "updated_at", when_used="unless-none")
def serialize_datetime(self, value: datetime) -> str:
return value.isoformat()
Expand Down
Loading