-
Notifications
You must be signed in to change notification settings - Fork 421
feat: add PATCH /api/v1/dataset/{dataset_id}/records
endpoint
#3934
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
Merged
gabrielmbmb
merged 26 commits into
feature/support-for-metadata-filtering-and-sorting
from
feature/patch-record-bulk-endpoint
Oct 17, 2023
Merged
feat: add PATCH /api/v1/dataset/{dataset_id}/records
endpoint
#3934
gabrielmbmb
merged 26 commits into
feature/support-for-metadata-filtering-and-sorting
from
feature/patch-record-bulk-endpoint
Oct 17, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1e0f957
to
a80cd01
Compare
5ebb32c
to
62cac52
Compare
…o feature/patch-record-bulk-endpoint
62cac52
to
34bbc94
Compare
The URL of the deployed environment for this PR is https://argilla-quickstart-pr-3934-ki24f765kq-no.a.run.app |
…o feature/patch-record-bulk-endpoint
…o feature/patch-record-bulk-endpoint
gabrielmbmb
commented
Oct 17, 2023
frascuchon
reviewed
Oct 17, 2023
frascuchon
reviewed
Oct 17, 2023
frascuchon
reviewed
Oct 17, 2023
edd1a37
to
abc8596
Compare
…o feature/patch-record-bulk-endpoint
frascuchon
approved these changes
Oct 17, 2023
f6e7766
into
feature/support-for-metadata-filtering-and-sorting
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area: api
Indicates that an issue or pull request is related to the Fast API server or REST endpoints
type: enhancement
Indicates new feature requests
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds the following:
PATCH /api/v1/records/{record_id}
added in feat: addPATCH /api/v1/records/{record_id}
endpoint #3920 allowing also to update the suggestions of a record. The suggestions in the input payload will replace the old suggestions.PATCH /api/v1/datasets/{dataset_id}/records
endpoint allowing to batch/bulk update the records of a dataset. The endpoint allow to update the same attributes from the record as in thePATCH /api/v1/records/{record_id}
endpoint.SearchDocument
getter dict to do not try to populate theSearchDocument.responses
attribute if the relationship has not been loaded (this allows us to not to have to load theRecord.responses
when updating the record document in theSearchEngine
usingadd_records
)SearchEngine.update_record_metadata
method as the same logic is covered bySearchEngine.add_records
method, which can be also used to update the fields of an existing document.SearchEngine.add_records
method toSearchEngine.index_records
as it can be used to both add and update records.Type of change
How Has This Been Tested
I made an small benchmark to test the latency of the new endpoint. I've created a dataset with 100000 records and all the possible questions and metadata properties. Then I built batches of 1000 records, updating all the responses and metadata fields, and sent them to the API. The average response time of the bulk
PATCH
endpoint was ~= 0.8 seconds.Code used for benchmark
Checklist
CHANGELOG.md
file (See https://keepachangelog.com/)