Skip to content

feat(competitions): add --public to competitions leaderboard - #1222

Merged
stevemessick merged 2 commits into
Kaggle:mainfrom
aadi-joshi:fix/leaderboard-public-flag
Oct 23, 2026
Merged

stevemessick merged 2 commits into
Kaggle:mainfrom
aadi-joshi:fix/leaderboard-public-flag

Conversation

@aadi-joshi

Copy link
Copy Markdown
Contributor

Summary

leaderboard --show and --download return different leaderboards on a concluded competition, and neither says which. This adds --public so the public leaderboard is reachable from --show.

Problem

--show calls GetLeaderboard, whose override_public field the CLI never set, so it returns the final leaderboard. --download calls DownloadLeaderboard, which has no such field and returns the public one. On playground-series-s6e8:

--show                          --download
0.97176  Chris Deotte           0.97207  Chris Deotte
0.97123  MILANFX                0.97154  Changye Li
0.97120  Changye Li             0.97149  MILANFX

Ranks 2 and 3 swap, and further down the two lists hold different teams. Measurements for three competitions are on #731.

Solution

--public sets override_public on the GetLeaderboard request:

kaggle competitions leaderboard playground-series-s6e8 --show --public
  teamId  teamName      submissionDate              score
--------  ------------  --------------------------  -------
16724329  Chris Deotte  2026-08-30 23:14:31.186000  0.97207
16698321  Changye Li    2026-08-30 12:49:14.556000  0.97154
16633740  MILANFX       2026-08-31 23:53:41.770000  0.97149

which is what --download gives.

The field is only set when the flag is passed, so without it the request is what it was and --show still returns the final leaderboard. I left that default alone because it is what the competition page shows by default once a competition has concluded.

--download is unchanged, and --public does not reach it.

The help text and docs/competitions.md now say which leaderboard each flag returns. Both previously described a difference in destination only, which is what makes this easy to miss.

On --download

It still cannot return the final leaderboard. That needs either override_public added to the DownloadLeaderboard request, which is a kagglesdk and server change rather than a CLI one, or serving --download by paging GetLeaderboard. The second stays in this repo but costs one request per 200 rows, and those rows carry only team_id, team_name, submission_date and score, so the CSV would lose the Rank, SubmissionCount and TeamMemberUserNames columns the server writes today. Asked on #731 instead of picking one.

Testing

  • hatch -e test run pytest tests/unit (1408 passed, 3 skipped)
  • hatch run lint:all
  • Live against the API: --show --public matches --download on playground-series-s6e8, --show on its own is unchanged, and on the running arc-prize-2026-arc-agi-2 both forms return the same rows
  • Maintainer: please run /gcbrun when convenient

Eight new tests cover the flag setting the field, the default leaving the request alone, paging still applying alongside it, the CLI forwarding the flag, and --public not altering the download call. Seven of the eight fail against the previous code. The one that does not is the regression guard on the no-flag request, which has to pass either way. One existing parser test gained an assertion that public defaults to False.

Related

Part of #731. It does not close it, since the --download half is still open.

On a competition that has concluded, `leaderboard --show` and `--download`
return different leaderboards and neither says so. `--show` calls
GetLeaderboard, whose override_public field was never set, so it returns the
final leaderboard. `--download` calls DownloadLeaderboard, which has no such
field and returns the public one. On playground-series-s6e8 the top three
differ in both score and order between the two.

Add --public, which sets override_public on the GetLeaderboard request, so the
public leaderboard is reachable from --show and the two commands can be
compared like for like. The field is only set when the flag is passed, so
without it the request is what it was and --show still returns the final
leaderboard, matching what the competition page shows by default.

Spell out in the help text and docs which leaderboard each flag returns, since
both previously described a difference in destination only.

DownloadLeaderboard still cannot return the final leaderboard. Closing that
gap needs a decision recorded on Kaggle#731.

Part of Kaggle#731
@aadi-joshi

Copy link
Copy Markdown
Contributor Author

This doesn't touch --download, which still can't give you the final leaderboard. DownloadLeaderboard has no override_public field, so either it gets added there (kagglesdk + server, so not something I can do here), or --download gets rebuilt on paged GetLeaderboard calls. I could do that second one, but it's a request per 200 rows, and the rows only have team_id, team_name, submission_date and score, so the CSV would lose Rank, SubmissionCount and TeamMemberUserNames.

Please let me know which you want and I'll do it in a follow-up ! Or we leave --download public only, if the help and docs here are enough

@stevemessick

Copy link
Copy Markdown
Contributor

/gcbrun

@sridipbasu sridipbasu added the enhancement New feature or request label Oct 21, 2026
@stevemessick

Copy link
Copy Markdown
Contributor

/gcbrun

@stevemessick stevemessick left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! We can leave --download as-is, for now.

@stevemessick
stevemessick merged commit 2076e08 into Kaggle:main Oct 23, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants