fix(cli): prevent silent partial uploads on upload failure - #1150
Merged
stevemessick merged 1 commit intoJul 29, 2026
Conversation
Contributor
|
/gcbrun |
stevemessick
approved these changes
Jul 29, 2026
Contributor
|
Thanks! |
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
When creating a dataset or model version, a failed file upload could be silently ignored. If
_upload_blob()returnedNone—either because the upload failed or because all resume attempts were exhausted—the file was skipped, the create request still went through, and the CLI reported success. This could result in a dataset or model version being created with one or more missing files.This change makes upload failures abort the operation instead of creating a partial upload.
Fix
ValueErrorwhen a file upload fails instead of returningNone.EXPIREDupload state for resumable uploads whose session can no longer be resumed.FAILEDresult still gives up, since the server rejected the upload and restarting would only hit the same error.Behavior change
Since
_upload_file()is shared, this also affects two other commands:kaggle competitions data updatenow aborts if any file upload fails instead of creating a partial data version.kaggle files uploadnow aborts if a file upload fails instead of skipping the failed file and continuing.The CLI now exits with a non-zero status when an upload fails, making these failures visible to automation.
Tests
Added regression tests to verify that:
Ran:
pytest tests/unit/test_upload_helpers.pypytest tests/unit/test_dataset_create.pypytest tests/unit/test_model_create.pyAlso ran the full unit test suite to verify there were no regressions.