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


##########
superset-frontend/plugins/plugin-chart-ag-grid-table/src/buildQuery.ts:
##########
@@ -534,7 +534,7 @@ const buildQuery: BuildQuery<TableChartFormData> = (
               expression.includes('\n');
             const wrappedExpression = isExpression
               ? `(${expression})`
-              : expression;
+              : `"${expression}"`;

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>SQL Dialect Incompatibility in Label Resolution</b></div>
   <div id="fix">
   
   This change incorrectly wraps simple SQL expressions in double quotes when 
resolving labels in AG Grid complex filters. Since Superset supports multiple 
SQL dialects (e.g., MySQL uses backticks, SQL Server uses brackets), hardcoding 
double quotes will generate invalid SQL for many databases, leading to query 
failures. The original behavior of leaving simple expressions unquoted was 
correct.
   </div>
   
   
   <details>
   <summary>
   <b>Code suggestion</b>
   </summary>
   <blockquote>Check the AI-generated fix before applying</blockquote>
   <div id="code">
   
   
   ````suggestion
                 const wrappedExpression = isExpression
                   ? `(${expression})`
                 : expression;
   ````
   
   </div>
   </details>
   
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #e8daf7</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