Kaggle / Kaggle/kaggle-cli

datasets files --format json prefixes stdout with pagination text

Open
#1,186 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
7.5k
Forks
1.4k
Avg merge
3d 15h
Merged PRs (30d)
11

Description

`kaggle datasets files / --page-size 1 --format json` in CLI 2.2.4 writes a `Next Page Token = ...` line before the JSON array when the API response is paginated. This makes stdout invalid JSON for callers that use the documented JSON format.

Expected: stdout is valid JSON for `--format json`; pagination information can go to stderr or be represented in the JSON payload.

The source is `KaggleApi.dataset_list_files_cli`, which prints the page token before `print_results(..., output_format=output_format)`.

I have a focused regression test and PR ready that preserves the token on stderr for JSON output and keeps the current stdout behavior for table/CSV output.

Contributor guide

Open the contributing guide

Research direction

Start at the named KaggleApi.dataset_list_files_cli method and inspect the focused regression test mentioned in the issue. Verify that JSON output remains valid when pagination occurs, that the token goes to stderr for JSON output, and that table/CSV stdout behavior is unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.