-
Notifications
You must be signed in to change notification settings - Fork 377
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: format_as("datasets")
when no responses
#3224
Conversation
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.
cool @alvarobartt ! please ask someone to review this as I might just approve it blindly 😄
# Description Due to the recent constraint for the `FeedbackRecord.user_id`s to be `UUID`s instead of `str`s, the conversion to `dict()` was failing, as the `UUID`s are not JSON-serializable, which was leading to some issues when trying to add the example record to the `DatasetCard` via the `dict()` conversion. **Type of change** - [X] Bug fix (non-breaking change which fixes an issue) **How Has This Been Tested** - [X] Re-run unit tests to pass when generating the `DatasetCard` for `FeedbackDataset`s **Checklist** - [X] I have merged the original branch into my forked branch - [ ] 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 - [ ] 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/)
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## develop #3224 +/- ##
===========================================
+ Coverage 90.91% 91.03% +0.12%
===========================================
Files 215 218 +3
Lines 11304 11512 +208
===========================================
+ Hits 10277 10480 +203
- Misses 1027 1032 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
Description
As just reported by @dvsrepo, the following flow:
FeedbackDataset.from_argilla() -> .format_as("datasets")
was failing under some scenarios where either the optional responses had no value or there were no responses at all, as either we were trying to retrieve those when any, or we were setting it's value toNone
if not found, instead of{"user_id": None, "values": None, "status": None}
which is what 🤗 Datasets is producing based on the features.So on, this PR solves that bug and now the flow mentioned above is possible and works as expected!
Type of change
How Has This Been Tested
feedback_dataset_records
has been modified to contain a record with and another without responsesChecklist