submit_to_kaggle: readable result + graceful auth handling#2
Merged
Conversation
The kaggle CLI exits 0 and prints "Successfully submitted ..." buried under a version-upgrade warning, so the raw CompletedProcess repr didn't make success obvious; a missing token produced an ugly traceback. - Return a KaggleSubmissionResult (truthy on success, clean __repr__, Kaggle's response on .detail, raw process on .process/.stdout/.stderr) and print a one-line ✅/❌ status (verbose=True). - Detect success from the "Successfully submitted" marker, not just the exit code (the CLI can exit 0 on some errors), and drop the version warning noise. - Fail fast with actionable guidance when no credentials are configured; give a clean auth message when the CLI rejects them. - Check installation with importlib.util.find_spec instead of `import kaggle`, which authenticates eagerly and would raise just from the availability check. - tests/test_competition_submission.py: offline coverage (subprocess mocked). - examples/submit_pnpl2026.ipynb: display the result object; use the real pnpl-competition-2026 slug.
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.
The kaggle CLI exits 0 and prints "Successfully submitted ..." buried under a version-upgrade warning, so the raw CompletedProcess repr didn't make success obvious; a missing token produced an ugly traceback.
import kaggle, which authenticates eagerly and would raise just from the availability check.