nytai opened a new pull request, #43369:
URL: https://github.com/apache/superset/pull/43369

   ### SUMMARY
   
   Charts whose metric labels all end in a forecast suffix (`__yhat`, 
`__yhat_lower`, `__yhat_upper`) render a **"No data"** tooltip even though the 
series plot fine.
   
   [#30819](https://github.com/apache/superset/pull/30819) made the tooltip 
formatter do `sortedKeys.filter(key => keys.includes(key))`, where `sortedKeys` 
are raw ECharts series ids but `keys` are `Object.keys(forecastValues)` — keyed 
by *forecast-stripped* name. A real Prophet bundle also has a plain observation 
series, so `foo` matches itself and its row renders. When every series carries 
a suffix, all of them collapse onto one name, nothing matches, every row is 
dropped, and `tooltipHtml` emits its empty-rows placeholder.
   
   Fix: collapse the ordering keys onto the same forecast-stripped names before 
the intersection, in both the `Timeseries` and `MixedTimeseries` tooltips 
(identical defect in both). The `collapseForecastKeys` helper goes in 
`utils/forecast.ts` rather than `series.ts`, since `forecast.ts` already 
imports `sanitizeHtml` from `series.ts` and the reverse would be an import 
cycle.
   
   Genuine forecast charts are unaffected — they already rendered one row per 
collapsed series.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Tooltip on a line chart with metrics `ci__yhat`, `ci__yhat_lower`, 
`ci__yhat_upper`:
   
   - **Before:** `No data`
   - **After:** `ci    ŷ = 1.5 (0.5, 2.5)`
   
   ### TESTING INSTRUCTIONS
   
   1. Create a timeseries line chart with three metrics labelled `ci__yhat`, 
`ci__yhat_lower` and `ci__yhat_upper` (custom labels; forecasting stays off).
   2. Hover the chart — the tooltip shows a `ci` row instead of "No data".
   3. Confirm no regression on a chart with forecasting enabled: one row per 
series, still formatted `ŷ = … (…, …)`.
   
   Automated: `npx jest plugins/plugin-chart-echarts` — 84 suites / 923 tests 
pass. The three new `Timeseries` tooltip regression tests and the 
`collapseForecastKeys` unit tests all fail on unfixed source.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   Companion PR #312 applies the same fix to `6.0-adp`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to