-
Notifications
You must be signed in to change notification settings - Fork 412
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
fix: add missing question update validations #3967
fix: add missing question update validations #3967
Conversation
QuestionName = Annotated[ | ||
constr( | ||
regex=QUESTION_CREATE_NAME_REGEX, | ||
min_length=QUESTION_CREATE_NAME_MIN_LENGTH, | ||
max_length=QUESTION_CREATE_NAME_MAX_LENGTH, | ||
) | ||
title: constr( | ||
), | ||
PydanticField(..., description="The name of the question"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can move the regex
, min_length
and max_length
to the PydanticField
and use str
instead of constr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at some point we're going to have to do it anyway: https://docs.pydantic.dev/latest/migration/#constrained-types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we should do it for all of the annotated fields once we move to v2.
The URL of the deployed environment for this PR is https://argilla-quickstart-pr-3967-ki24f765kq-no.a.run.app |
…o fix/fix-question-update-validations
Codecov ReportAll modified lines are covered by tests ✅
📢 Thoughts on this report? Let us know!. |
Description
This PR adds the following changes:
title
anddescription
are using the same validations for update and create.settings
is now a non nullable field when updating.title
andvisible_for_annotators
are now non nullable fields when updating.Type of change
How Has This Been Tested
(Please describe the tests that you ran to verify your changes. And ideally, reference
tests
)Checklist