fix: return single_upload result from Project.upload()#502
Open
davidnichols-ops wants to merge 1 commit into
Open
fix: return single_upload result from Project.upload()#502davidnichols-ops wants to merge 1 commit into
davidnichols-ops wants to merge 1 commit into
Conversation
Project.upload() discarded the return value of single_upload(), returning None even on success. This made it impossible for callers to inspect the upload response (image id, timing, retry counts) without calling single_upload() directly. Now returns the single_upload() result dict for single-file uploads, and a list of such dicts for directory uploads. Existing callers that ignore the return value are unaffected.
2cb7530 to
b33b986
Compare
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
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.
Summary
Project.upload()was discarding the return value ofsingle_upload(), always returningNoneeven on successful uploads. This made it impossible for callers to inspect the upload response (image id, timing, retry counts) without callingsingle_upload()directly.single_upload()result dict for single-file uploads (keys:image,annotation,upload_time,annotation_time,upload_retry_attempts,annotation_upload_retry_attempts).Closes #254.
Test plan
python -m unittestpasses — 731 tests, OK (skipped=1)test_upload_single_file_returns_resultverifies single-file upload returns a dict with the expected image idtest_upload_directory_returns_list_of_resultsverifies directory upload returns a list of dicts with correct counttest_project_methodsintest_queries.pyto assert the new return value (was assertingNone)ruff checkandruff format --checkpass on all modified files