[DOM-75516] feat: leaderboard normalization utils + request project ID resolver#13
Merged
ddl-subir-m merged 5 commits intomainfrom Mar 24, 2026
Merged
Conversation
…lver - Add normalize_leaderboard_rows/payload to fix TimeSeries fit_time display - Add resolve_request_project_id() to centralize project context extraction from X-Project-Id header, query params, and DOMINO_PROJECT_ID env var Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced Mar 20, 2026
4 tasks
…roject_id The env var is the App's own project, not the target project the user is working in. Falling back to it silently operates on the wrong project (root cause of datasets showing empty in cross-project scenarios). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Query params are the canonical approach going forward. The X-Project-Id header is kept as a fallback for legacy clients only. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The frontend sends both header and query param from the same source. No scenario where header is present but query param isn't. Query param only — simpler. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
niole
approved these changes
Mar 24, 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.
Why
Leaderboard normalization: AutoGluon's TimeSeries models report training time as
fit_time_marginalbut omit thefit_timefield that tabular models produce. The frontend leaderboard table, diagnostics panels, and model export all expectfit_time. Rather than adding fallback logic in every consumer, this PR adds a normalization layer that copiesfit_time_marginal→fit_timewhen absent.Project ID resolution: Multiple endpoints need to know which Domino project the request is for (dataset listing, upload, job launch). The project ID can arrive via
X-Project-Idheader,projectId/project_idquery param, or theDOMINO_PROJECT_IDenv var. Rather than duplicating this resolution logic across routes,resolve_request_project_id()centralizes it.Summary
normalize_leaderboard_rows()andnormalize_leaderboard_payload()— copiesfit_time_marginal→fit_timeonly whenfit_timeis missingresolve_request_project_id()— checksX-Project-Idheader → query params → env varFile → consumer mapping
leaderboard_utils.pynormalize_leaderboard_payload)utils.py(resolve_request_project_id)routes/datasets.pycalls it for project-scoped dataset listing)These are small shared utilities (~45 lines each) grouped here because they're both "request context extraction" helpers. Each is fully tested in this PR.
Test plan
test_leaderboard_utils.pypassestest_api_utils.pypassesnormalize_leaderboard_rowscopiesfit_time_marginal→fit_timeonly whenfit_timeis missingresolve_request_project_idreturns correct value for header, query param, and env var inputs