Stacked "Only Total" still includes the sort-only metric on time-comparison charts (follow-up to #42881)
I maintainer di solito rispondono entro 2 giorni
@waterWang ci sta già lavorando.
Dal 11/8/2026.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 76/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- typescript
- Ambito
- data-visualization, frontend
Direzione di ricerca
Inizia in superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts, all'interno di extractDataTotalValues, quindi segui il flusso citato attraverso Timeseries/buildQuery.ts, getMetricOffsetsMap e timeComparePivotOperator. Aggiungi una copertura di regressione per una metrica di confronto temporale usata solo per l'ordinamento e verifica che il totale impilato e il limite della soglia contino solo le serie visualizzate, incluse le colonne derivate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Bug description
#42881 fixed the stacked "Only Total" label so it no longer includes a sort-only metric (timeseries_limit_metric). It handles the plain and verbose-named cases, but the exclusion is an exact-name match, so time-comparison derived columns of that same sort-only metric are still summed into the total.
On master, extractDataTotalValues in superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts:
const excludedKeys = new Set([xAxisCol, ...(extraMetricLabels ?? [])]);
...
if (excludedKeys.has(curr)) {
return prev;
}
excludedKeys holds SortMetric, so a column named SortMetric__1 year ago does not match and is added to the stacked total.
That column is reachable on any time-comparison chart that also uses a sort-only metric:
Timeseries/buildQuery.tsadds the extra metric into the query —metrics: [...(baseQueryObject.metrics || []), ...extra_metrics]getMetricOffsetsMapbuilds an offset key per query metric —[metric, offset].join(TIME_COMPARISON_SEPARATOR), i.e.SortMetric__1 year agotimeComparePivotOperatorpivots both the base and offset keys into the resultextractDataTotalValuessees the offset column, doesn't match it againstexcludedKeys, and includes it
The same inflated total also feeds thresholdValues, so the percentage-threshold cutoff for hiding small labels is off by the same amount.
How to reproduce
- Create a Timeseries Bar chart with two metrics, Stacked, Only Total enabled
- Set Sort By to a metric that is not among the displayed metrics
- Enable a Time Comparison offset (e.g.
1 year ago) - The total label above each bar exceeds the visible stack height
Expected results
The total should count only the displayed stacked series, matching the bar height, as it now does without a time offset.
Actual results
The total is inflated by the value of the sort-only metric's time-shifted column.
Environment
- Superset version:
master(as of #42881) - Browser: any
Possible fix
Match derived forms as well as the exact label, e.g. treating a key as excluded when it equals an extra metric label or begins with <label>__ (TIME_COMPARISON_SEPARATOR). Worth keeping the boundary tight so a distinct metric that merely shares a prefix — SortTotal vs Sort — is still counted.
Happy to open a PR with a fix and tests if that sounds right.
- Lingua principale
- Python
- Stelle
- 75.6k
- Fork
- 18.6k
- Merge medio
- 4g 2h
- PR unite (30g)
- 469
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/superset
-
SQL Lab: pasting text that matches no database into the "Data connection" select throws TypeErrorAperta#bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 2 giorni
-
#bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
apache/superset#46567 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
🦾 ai-candidate
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/superset#46238 · 3 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Explore filter: multi-select value list with allowNewOptions stops accepting values and drops earlier onesForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta🦾 ai-candidate
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/superset#46146 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
[Bug] Table chart applies Time grain to only the first temporal column (regression from 4.0.2)Forse già presa @PrakharAgarwal17 l’ha presa 24 giorni fa. Aperta#bug 🦾 ai-candidate
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
apache/superset#45964 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di apache/superset
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
bug crash needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Community-Access/quill#2135 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
munendra07-tech/agent-crashtest#20 ·
I maintainer di solito rispondono entro 1 giorno
-
braveapi: time range filter is sent as time_range, which the Brave API ignores (needs freshness)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
I maintainer di solito rispondono entro 1 giorno
-
request_access
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100