bito-code-review[bot] commented on code in PR #37072:
URL: https://github.com/apache/superset/pull/37072#discussion_r2685221981


##########
superset-frontend/plugins/plugin-chart-ag-grid-table/src/buildQuery.ts:
##########
@@ -120,6 +120,15 @@ const buildQuery: BuildQuery<TableChartFormData> = (
       }
     }
 
+    // Dashboard filter override - allows dashboard-level time shifts to 
OVERRIDE
+    // chart-level time shift settings (from PRs #33947 and #34014)
+    if (
+      extra_form_data?.time_compare &&
+      !timeOffsets.includes(extra_form_data.time_compare)
+    ) {
+      timeOffsets = [extra_form_data.time_compare];
+    }

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Incorrect override logic</b></div>
   <div id="fix">
   
   The added condition prevents overriding when the dashboard time_compare 
value is already present in the chart's timeOffsets array, but the comment 
indicates dashboard should OVERRIDE chart settings. This could lead to 
inconsistent behavior where dashboard filters don't take precedence if the 
value matches one in the chart's multiple shifts. If dashboard sets a single 
shift, it should always replace the chart's timeOffsets.
   </div>
   
   
   <details>
   <summary>
   <b>Code suggestion</b>
   </summary>
   <blockquote>Check the AI-generated fix before applying</blockquote>
   <div id="code">
   
   
   ````suggestion
       if (extra_form_data?.time_compare) {
         timeOffsets = [extra_form_data.time_compare];
       }
   ````
   
   </div>
   </details>
   
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #727e7f</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



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