Skip to content

fix: return single_upload result from Project.upload()#502

Open
davidnichols-ops wants to merge 1 commit into
roboflow:mainfrom
davidnichols-ops:fix/upload-return-value-254
Open

fix: return single_upload result from Project.upload()#502
davidnichols-ops wants to merge 1 commit into
roboflow:mainfrom
davidnichols-ops:fix/upload-return-value-254

Conversation

@davidnichols-ops

@davidnichols-ops davidnichols-ops commented Jun 30, 2026

Copy link
Copy Markdown

Summary

  • Project.upload() was discarding the return value of single_upload(), always returning None even on successful uploads. 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 (keys: image, annotation, upload_time, annotation_time, upload_retry_attempts, annotation_upload_retry_attempts).
  • For directory uploads, returns a list of such dicts — one per successfully uploaded image. Skipped (non-image) files are excluded from the list.
  • Existing callers that ignore the return value are completely unaffected — this is a backwards-compatible addition.

Closes #254.

Test plan

  • python -m unittest passes — 731 tests, OK (skipped=1)
  • New test test_upload_single_file_returns_result verifies single-file upload returns a dict with the expected image id
  • New test test_upload_directory_returns_list_of_results verifies directory upload returns a list of dicts with correct count
  • Updated existing test_project_methods in test_queries.py to assert the new return value (was asserting None)
  • ruff check and ruff format --check pass on all modified files
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant