bito-code-review[bot] commented on PR #42311:
URL: https://github.com/apache/superset/pull/42311#issuecomment-5048381515

   <!-- Bito Reply -->
   The flagged issue is correct. In `getBaselineSeriesForStream`, the 
assignment at line 80 (in the patched file) still attempts to access 
`series[0][i][0]` without verifying that `series[0][i]` is defined, which 
causes a runtime error when rows are ragged or null.
   
   To resolve this, you should add a null check for `series[0][i]` before 
accessing its first element. Here is the corrected implementation for that 
block:
   
   ```typescript
       const point = series[0][i];
       baselineSeriesDelta[i] = [
         point ? point[0] : 0,
         seriesSum === 0 ? 0 : -weightedSeriesSum / seriesSum,
       ];
   ```
   
   I have reviewed the PR changes and comments. There are no other pending 
review comments in this PR. Would you like me to implement this fix for you?
   
   
**superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts**
   ```
   const point = series[0][i];
       baselineSeriesDelta[i] = [
         point ? point[0] : 0,
         seriesSum === 0 ? 0 : -weightedSeriesSum / seriesSum,
       ];
   ```


-- 
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