Skip to content
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

[SPIKE] feat: refresh record count_submitted_responses column using context functions #5106

Conversation

jfcalvo
Copy link
Member

@jfcalvo jfcalvo commented Jun 25, 2024

Description

This PR include changes to explore the possibility of using a new column named count_submitted_responses to records table.

This new column will be refreshed every time a response is created/updated/deleted maintaining a correct counter value of the submitted responses that a record has.

With this value we can easily filter records that are in completed status, using the distribution strategy for the associated dataset.

Changes that are included in this PR:

  • Refresh count_submitted_responses when a response is created/updated/deleted.

Changes that are not present in this PR

  • Refresh count_submitted_responses when responses are created in bulk.
  • Refresh count_submitted_responses when records are created/upserted in bulk.
  • Refresh modified records into the search engine.
  • Include count_submitted_responses into the search engine mapping.
  • Add new calculated value status to record responses.
    • We need to explore if this could fit into the ORM model or Pydantic schemas.
  • Modify the search endpoint to return records with specific status value.

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
  • I filled out the contributor form (see text above)
  • I have added relevant notes to the CHANGELOG.md file (See https://keepachangelog.com/)

@jfcalvo jfcalvo requested a review from frascuchon June 25, 2024 10:26
Copy link

codecov bot commented Jun 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.99%. Comparing base (b23f3d8) to head (5adc94b).

Additional details and impacted files
@@                          Coverage Diff                          @@
##           feat/update-datasets-distribution    #5106      +/-   ##
=====================================================================
+ Coverage                              91.98%   91.99%   +0.01%     
=====================================================================
  Files                                    136      136              
  Lines                                   5850     5860      +10     
=====================================================================
+ Hits                                    5381     5391      +10     
  Misses                                   469      469              
Flag Coverage Δ
argilla-server 91.99% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Base automatically changed from feat/update-datasets-distribution to feat/create-datasets-with-distribution July 1, 2024 10:22
Base automatically changed from feat/create-datasets-with-distribution to feat/add-dataset-automatic-task-distribution July 1, 2024 10:31
@jfcalvo jfcalvo closed this Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant