Conversation
The search dialog was failing to open with "ValueError: Invalid value: -1"
because NiceGUI's select component has validation issues when using numeric
values with dict-based options and emit-value/map-options props.
Changed the direction select to use string values ('desc', 'asc') instead
of integers (-1, 1) and updated _perform_search to convert the string back
to the integer value expected by the HuggingFace service API.
Fixes the issue where clicking "Search Models" or "Search Datasets" in the
configure view would crash instead of opening the search dialog.
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the direction selection in the HuggingFace search dialog to use string values ('desc', 'asc') instead of integer values (-1, 1), improving code readability and maintainability while preserving the same functionality.
Key Changes:
- Updated the direction selector options to use string values ('desc', 'asc') instead of integers (-1, 1)
- Added conversion logic to translate string direction values back to integers before passing to the HuggingFace service
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Automated review 🤖 Summary of Changes Key Changes & Positives
Potential Issues & Recommendations
Language/Framework Checks
Security & Privacy
Build/CI & Ops
Tests
Approval Recommendation
|
The search dialog was failing to open with "ValueError: Invalid value: -1" because NiceGUI's select component has validation issues when using numeric values with dict-based options and emit-value/map-options props.
Changed the direction select to use string values ('desc', 'asc') instead of integers (-1, 1) and updated _perform_search to convert the string back to the integer value expected by the HuggingFace service API.
Fixes the issue where clicking "Search Models" or "Search Datasets" in the configure view would crash instead of opening the search dialog.