Skip to content

Fix kernel URL references for kernel_read and kernel client#19

Open
fallintoplace wants to merge 1 commit into
NVIDIA:mainfrom
fallintoplace:fix/kernel-read-support-kaggle-url
Open

Fix kernel URL references for kernel_read and kernel client#19
fallintoplace wants to merge 1 commit into
NVIDIA:mainfrom
fallintoplace:fix/kernel-read-support-kaggle-url

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Why

The kernel documentation accepts Kaggle code URLs, but the kernel_read CLI and KaggleKernelClient previously expected owner/slug references. A full URL could therefore be parsed as the wrong owner and slug.

What changed

  • Normalize Kaggle code URLs to owner/slug at the CLI boundary and in KaggleKernelClient.
  • Print a note to stderr when scriptVersionId is present because kernel_read fetches the latest kernel version. Use kernel_archive.py for a specific historical version.
  • Add regression coverage for URL references, owner/slug references, and the warning behavior.

Validation

  • uv run pytest

@daxiongshu daxiongshu self-assigned this Jul 6, 2026
@daxiongshu

Copy link
Copy Markdown
Collaborator

Thank you! Nice fix — one small thing before merge. Versioned URLs like
https://www.kaggle.com/code/jiweiliu/kaggle-agent-ensemble-with-yash9439?scriptVersionId=312497119
normalize fine, but the scriptVersionId gets silently dropped and kernel_read fetches the latest version. Do I get this right? If so, can we warn instead of staying silent? Something like:

normalized_kernel_ref = kernel_ref(args.kernel_ref)
if "scriptVersionId=" in args.kernel_ref:
    print(
        "Note: scriptVersionId is ignored — kernel_read always fetches the latest "
        "version. Use kernel_archive.py to fetch a specific historical version."
    )

Everything else LGTM — tests pass locally against latest main. 👍

@fallintoplace fallintoplace force-pushed the fix/kernel-read-support-kaggle-url branch from 0dbe3c8 to 645576c Compare July 10, 2026 08:58
Signed-off-by: Minh Vu <vuhoangminh97@gmail.com>
@fallintoplace fallintoplace force-pushed the fix/kernel-read-support-kaggle-url branch from 645576c to 0f759b8 Compare July 10, 2026 09:01
@fallintoplace

Copy link
Copy Markdown
Contributor Author

Thank you for the review, I have pushed the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants