Argilla is a collaboration platform for AI engineers and domain experts that require high-quality outputs, full data ownership, and overall efficiency.
Added count_submitted_responses as a column_property of Record database model.
This value is get from the database using a subquery.
This is done by SQLAlchemy when getting the record but due to some special scenarios record entities need to be refreshed using refresh session function.
Added count_submitted_responses to search engine mapping.
Record status is exposed by API schemas and is calculated based in count_submitted_responses column property from Record database model.
This status is defined as a property inside Record database model and it's using the dataset distribution strategy to calculate the value.
Missing changes in this PR
Add support to status value in search endpoints so we can filter by status=pending&response_status=pending.
Check that we are refreshing the record count_submitted_responses values before indexing the record and add a partial update into the search engine when some associated entity (like responses) are create/updated/deleted for a record. (We probably should add a partial update of the index for this record attribute).
Refs #5069
Type of change
(Please delete options that are not relevant. Remember to title the PR according to the type of change)
[ ] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] Refactor (change restructuring the codebase without changing functionality)
[ ] Improvement (change adding some improvement to an existing functionality)
[ ] Documentation update
How Has This Been Tested
(Please describe the tests that you ran to verify your changes. And ideally, reference tests)
[ ] Test A
[ ] Test B
Checklist
[ ] I added relevant documentation
[ ] follows the style guidelines of this project
[ ] I did a self-review of my code
[ ] I made corresponding changes to the documentation
[ ] My changes generate no new warnings
[ ] I have added tests that prove my fix is effective or that my feature works
Description
This PR include the following changes:
count_submitted_responses
as acolumn_property
ofRecord
database model.refresh
session function.count_submitted_responses
to search engine mapping.status
is exposed by API schemas and is calculated based incount_submitted_responses
column property fromRecord
database model.status
is defined as a property insideRecord
database model and it's using thedataset
distribution strategy to calculate the value.Missing changes in this PR
status
value in search endpoints so we can filter bystatus=pending&response_status=pending
.count_submitted_responses
values before indexing the record and add a partial update into the search engine when some associated entity (like responses) are create/updated/deleted for a record. (We probably should add a partial update of the index for this record attribute).Refs #5069
Type of change
(Please delete options that are not relevant. Remember to title the PR according to the type of change)
How Has This Been Tested
(Please describe the tests that you ran to verify your changes. And ideally, reference
tests
)Checklist