forked from argilla-io/argilla
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: allow
required=False
fields to be logged in Argilla (argilla-i…
…o#3846) # Description This PR addresses an issue with the Argilla API, since it's not handling optional values passed as e.g. `{"required": "text", "optional_value": None}` neither when those optional fields are not provided as part of the payload e.g. `{"required": "text"}`. So on, in the PR the API validation when creating new records has been fixed to check that the optional fields are neither None nor str, instead of applying the same check as for the required fields; plus improving the `to_server_payload` method in the `FeedbackRecord` schema not to include the fields with value None. Closes argilla-io#3845 **Type of change** - [X] Bug fix (non-breaking change which fixes an issue) **How Has This Been Tested** - [x] Add unit tests for `FeedbackRecord.to_server_payload` with `required=False` fields - [X] Add unit tests for the validation on the API-side when creating records via `validate_record_fields` **Checklist** - [ ] I added relevant documentation - [X] follows the style guidelines of this project - [X] I did a self-review of my code - [ ] I made corresponding changes to the documentation - [X] My changes generate no new warnings - [X] I have added tests that prove my fix is effective or that my feature works - [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK) (see text above) - [X] I have added relevant notes to the CHANGELOG.md file (See https://keepachangelog.com/) --------- Co-authored-by: Francisco Aranda <[email protected]> Co-authored-by: Gabriel Martín Blázquez <[email protected]>
- Loading branch information
1 parent
4fce163
commit 92392c4
Showing
6 changed files
with
57 additions
and
6 deletions.
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
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