This repository has been archived by the owner on Jun 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
feat: add uniqueness field validation for span questions #60
Merged
frascuchon
merged 6 commits into
feat/support-for-span-questions
from
feat/add-uniqueness-field-validation-for-span-questions
Mar 8, 2024
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
dcf2908
chore: load dataset with fields and questions
frascuchon 18491a7
feat: Add validation to avoid several span questions using the same f…
frascuchon 68e0101
tests: Adding more tests
frascuchon cfb72e5
chore: Add TODO
frascuchon dfe0c34
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] b1ce3bf
Update tests/unit/api/v1/datasets/test_create_dataset_question.py
frascuchon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I already added in one commit a property to
Question
database model to check if if span or not. But after some changes I removed it because I was not using it.Take a look to the commit here: 799743b#diff-b7efe64daa88a5d7c98088e2a66d38739605226e60d4ed967712ca2790c54931
If you want to apply that change then you can do:
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.
I prefer to keep it as is. We already have other places using this kind of condition with settings directly and it can be confusing seeing
is_span
orsettings.type == QuestionType.span
depending on the context.We can review it later when using question validators. However, migrating the project to Python 3.10 and using the pattern-matching switch would be a better option.