feat(cli): add --no-run to kernels push to save a version without running it - #1185
Open
aadi-joshi wants to merge 1 commit into
Open
feat(cli): add --no-run to kernels push to save a version without running it#1185aadi-joshi wants to merge 1 commit into
aadi-joshi wants to merge 1 commit into
Conversation
Every push queues a full execution, so correcting a typo in a markdown cell means re-running the whole notebook. The web UI has this under Save Version as Quick Save, and the API already supports it: ApiSaveKernelRequest carries kernel_execution_type, and KernelExecutionType.QUICK_SAVE is in the pinned kagglesdk. The CLI never set the field, so the server always saved and ran. Add --no-run, which sets the field to QUICK_SAVE and leaves the default untouched. The success message no longer points at run progress in that case, because nothing is running. Verified against the live API by pushing the same notebook twice. With --no-run the version settled in 24 seconds and its log contains none of the notebook's own output. Without it the same notebook ran for 60 seconds and the log contains its print exactly once. Fixes Kaggle#493
Collaborator
|
I have taken a look at this change with the upcoming LRO work in mind. Most probably there is no conflict as it is limited to the existing The default CC: @stevemessick |
Contributor
|
/gcbrun |
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
kaggle kernels pushalways queues a full execution, so correcting a typo in a markdown cell means re-running the whole notebook. This adds--no-run, which saves a new version without executing it, the equivalent of Quick Save in the web UI.Problem
There is no way to save a version without running it. I hit this during a playground competition, where a one word fix in a markdown cell cost a full re-run, twice.
kernels pushaccepts only-p/--path,-t/--timeoutand--accelerator.Solution
The API already supports this and the CLI was not passing it through.
ApiSaveKernelRequestcarries:and the pinned kagglesdk has:
kernel_execution_typedid not appear anywhere inkaggle_api_extended.pyorcli.py, so every push left it unspecified and the server saved and ran.--no-runsets the field toQUICK_SAVE. The default path does not set it at all, so nothing changes for existing users. No kagglesdk bump is needed.The success message is adjusted for that case, because pointing at run progress when nothing is running would be misleading:
Testing
hatch -e test run pytest tests/unit/test_kernels_push_no_run.py -v(7 passed)hatch -e test run pytest tests/unit(1318 passed, 3 skipped)hatch run lint:allprint("MARKER")followed bytime.sleep(40):--no-runThe quick saved version settled in less time than its own sleep and its log holds no cell output, so the version was created without the cells being executed. The control run behaves exactly as before.
/gcbrunwhen convenientNew tests cover that
--no-runsetsQUICK_SAVE, that a default push leaves the execution type unset, that--acceleratorand--timeoutstill apply alongside it, that both CLI wrappers forward the flag, and that each of the two success messages is produced. Seven of the nine fail against the previous code; the two that do not are the regression guards on the default path.Docs updated in
docs/kernels.mdandskills/references/kernels.md.A note on the flag name
I went with
--no-runbecause it matches the request in #493 and the existing--no-resume,--no-compress,--no-warnstyle in this CLI.--quick-savewould match the web UI and the enum more literally. Happy to rename if you prefer that.Worth being precise about what it does: a session is still created briefly to render the version, so
kernels statusreports RUNNING for a few seconds. What does not happen is any cell executing. The help text and docs say it that way rather than promising that nothing runs at all.Related
Fixes #493