Migrate Kaggle authentication to API token and add dataset source - #869
Merged
Conversation
Update KaggleCredential to authenticate with a single KAGGLE_API_TOKEN instead of the legacy username:key pair. verify() requires the token to authenticate via the ACCESS_TOKEN method, and apply() re authenticates the module level kaggle.api instance when it was already imported.
Add KaggleDatasetSource inheriting from BaseDatasetSource, exposing search, get_info and download_dataset through the official kaggle library (kaggle 2.x). Public datasets work anonymously; an optional KaggleCredential is applied when downloading. Register it as a DatasetSource component on startup.
6 tasks
Kaggle ignores page_size and never fills next_page_token, so the search returned twenty rows whatever was asked and its cursor was always None: the Hub could never load a second page. The page parameter does work, so the cursor is now the page number as a string, the way the Zenodo source already does it, and a page shorter than Kaggle's fixed size is read as the last one. Entries are not trimmed to the requested limit, because the next page starts where this one ended and a trimmed row is never served again. The credential and the source rely on the kaggle 2.x token API, which the old ">=1.7.4.5" floor did not guarantee. With Python 3.10 gone the lock already resolves 2.2.4 everywhere; the pin makes the requirement explicit.
cristian-tamblay
approved these changes
Sep 10, 2026
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
Updated the Kaggle credential to authenticate with the modern kaggle 2.x API access token (
KAGGLE_API_TOKEN, e.g.KGAT_...) instead of the legacyusername:keypair, and added a newKaggleDatasetSourceso users can search, preview, and download Kaggle datasets directly in dashAI.Type of Change
Check all that apply like this [x]:
Changes (by file)
DashAI/back/credentials/kaggle_credential.py: migratedKaggleCredentialto a single Kaggle API access token.verify()now authenticates withkaggle 2.xand only accepts a token that authenticates via theACCESS_TOKENmethod;apply()exportsKAGGLE_API_TOKENand re authenticates the module levelkaggle.apiinstance when it was already imported.tests/back/credentials/test_concrete_credentials.py: updated thefake_kagglestub for the token flow and added tests for successful/failed/expired/empty token verification andapply().DashAI/back/dataset_sources/kaggle_dataset_source.py: newKaggleDatasetSource(BaseDatasetSource)using the officialkagglelibrary (kaggle 2.x). Implementssearch()(with pagination via Kaggle page tokens),get_info()(description, keywords, total size), anddownload_dataset()(downloads and unzips into the target path). Public datasets work anonymously; the optionalKaggleCredentialis applied when downloading for private/consent gated datasets. Suppresses kaggle's import time auth help output.tests/back/dataset_sources/test_kaggle_dataset_source.py: new tests covering search mapping and pagination,get_infoenrichment and error handling, anddownload_dataset.DashAI/back/initial_components.py: registeredKaggleDatasetSourceso it appears automatically in the DatasetSource registry (frontend Hub discovers sources from the registry, so no frontend changes were needed).Testing (optional)
uciml/iris).Notes (optional)
username:keyKaggle credentials will fail verification with the new format and must be regenerated as access tokens from https://www.kaggle.com/settings/api. Backwards compatibility is not handled.