Commit 157003f
fix: return single_upload result from Project.upload() (#502)
* fix: return single_upload result from Project.upload() (#254)
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.
* fix: return list from upload() in both single and directory cases
Per review feedback on PR #502: wrap the single-file return in a list
so upload() always returns list[dict] regardless of input type.
- single file: return [single_upload_result] instead of single_upload_result
- directory: unchanged (already returns list)
- update docstring to reflect consistent list return type
- update tests in test_project.py and test_queries.py accordingly
---------
Co-authored-by: davidnichols-ops <your-email@example.com>
Co-authored-by: Rodrigo Barbosa <rodrigo@roboflow.com>1 parent 613e9f2 commit 157003f
3 files changed
Lines changed: 74 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
409 | 409 | | |
410 | 410 | | |
411 | 411 | | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
412 | 419 | | |
413 | 420 | | |
414 | 421 | | |
| |||
445 | 452 | | |
446 | 453 | | |
447 | 454 | | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
461 | 470 | | |
462 | 471 | | |
| 472 | + | |
463 | 473 | | |
464 | 474 | | |
465 | 475 | | |
466 | 476 | | |
467 | | - | |
| 477 | + | |
468 | 478 | | |
469 | 479 | | |
470 | 480 | | |
| |||
477 | 487 | | |
478 | 488 | | |
479 | 489 | | |
| 490 | + | |
480 | 491 | | |
481 | 492 | | |
482 | 493 | | |
483 | 494 | | |
| 495 | + | |
484 | 496 | | |
485 | 497 | | |
486 | 498 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
155 | 156 | | |
156 | 157 | | |
157 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
158 | 203 | | |
159 | 204 | | |
160 | 205 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
| |||
0 commit comments