-
Notifications
You must be signed in to change notification settings - Fork 68
Refactor Dataset create_data_rows_sync to use upsert #1694
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
vbrodsky
merged 13 commits into
develop
from
VB/create-data-rows-sync-use-upsert_PLT-1066
Jul 1, 2024
Merged
Refactor Dataset create_data_rows_sync to use upsert #1694
vbrodsky
merged 13 commits into
develop
from
VB/create-data-rows-sync-use-upsert_PLT-1066
Jul 1, 2024
Conversation
This file contains hidden or 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
4d48571
to
9cc14e5
Compare
5ff6529
to
e5ea71d
Compare
mrobers1982
reviewed
Jun 27, 2024
4500e3a
to
3ca28a0
Compare
mrobers1982
reviewed
Jun 28, 2024
specs = DataRowCreateItem.build(self.uid, upload_items) | ||
task: DataUpsertTask = self._exec_upsert_data_rows( | ||
specs, file_upload_thread_count) | ||
task.wait_till_done() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Can this call create_data_rows
to obtain a DataUpsertTask
to avoid code duplication.
mrobers1982
previously approved these changes
Jun 28, 2024
mrobers1982
approved these changes
Jun 28, 2024
e4c7b5e
to
b5e247a
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 introduces improvements to the data row creation process within the SDK.
This PR refactors the following two data row creation methods:
Dataset.create_data_row
Dataset.create_data_row_sync
Both methods now leverage the upsert mutation for data row creation.
Since the upsert mutation is asynchronous, a task waiting mechanism has been implemented within these methods to ensure synchronous data row creation behavior.
A new ResourceCreationError exception has been introduced. This exception provides informative error messages in case of data creation failures, replacing the previous approach of returning None.
Stories:
https://labelbox.atlassian.net/browse/PLT-1066
https://labelbox.atlassian.net/browse/PLT-1067
On test failures:
Type of change
Please delete options that are not relevant.
All Submissions
New Feature Submissions
Changes to Core Features