You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement a dedicated TableQuestion type and improve table answer handling to properly manage table data in questions and responses. This implementation leverages workspace schema configuration for enhanced validation, type safety, and better user experience.
Problem
Table answers are stored as stringified JSON in TextQuestionAnswer objects
No dedicated question type for tables in the backend
Limited validation and processing capabilities for table answers
Inefficient serialization/deserialization between frontend and backend
Complex and error-prone table handling in the frontend
No integration with workspace schema configuration for table validation
Proposed Solution
Create Dedicated TableQuestion Type: Add proper table question support to backend models
Leverage Workspace Schema Configuration: Use schema definitions for table answer validation
Enhance Frontend TableQuestionAnswer: Improve table handling with schema awareness
Implement Schema-Aware Validation: Validate table answers against workspace schema definitions
Improve User Experience: Create better table editing and review interfaces
Implementation Details
Dependencies
Workspace schema configuration infrastructure should be available for optimal validation
SchemaService should provide table schema definitions and validation
Backend Changes
Add table question type to enums:
classQuestionType(str, Enum):
text="text"multi_label="multi_label"single_label="single_label"rating="rating"ranking="ranking"span="span"table="table"# New type
Create migration scripts for existing table questions:
defupgrade():
# Identify existing text questions with table data# Convert question type from 'text' to 'table'# Update question settings with table configuration# Migrate existing table answers to new format
Implement backward compatibility:
Support existing table answers during transition
Gradual migration of question types
Fallback handling for legacy table data
Related Files
extralit/argilla-server/src/argilla_server/models/database.py - Enhanced Question model
Description
Implement a dedicated
TableQuestiontype and improve table answer handling to properly manage table data in questions and responses. This implementation leverages workspace schema configuration for enhanced validation, type safety, and better user experience.Problem
TextQuestionAnswerobjectsProposed Solution
Implementation Details
Dependencies
Backend Changes
Add table question type to enums:
Enhance Question model with table support:
Update question settings for table-specific configuration:
Schema Integration
Use workspace schema configuration for table answer validation:
Enhance answer processing for table questions:
Frontend Changes
Enhance TableQuestionAnswer class:
Improve table rendering and editing components:
Integrate with workspace schema configuration:
API Changes
Update question handlers for table support:
Enhance answer processing for table questions:
Migration Strategy
Create migration scripts for existing table questions:
Implement backward compatibility:
Related Files
extralit/argilla-server/src/argilla_server/models/database.py- Enhanced Question modelextralit/argilla-server/src/argilla_server/enums.py- Updated QuestionType enumextralit/argilla-server/src/argilla_server/services/SchemaService.py- Table validation logicextralit/argilla-server/src/argilla_server/api/handlers/v1/datasets/questions.py- Enhanced question handlersextralit/argilla-frontend/v1/domain/entities/question/QuestionAnswer.ts- Enhanced answer modelsextralit/argilla-frontend/components/features/table-question/- New table question componentsAcceptance Criteria
TableQuestiontype exists in backend models with proper enum supportRelated Issues
This is part of the strategic workspace-level schema management enhancement: