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


##########
superset-frontend/src/components/Datasource/components/DatasourceEditor/DatasourceEditor.tsx:
##########
@@ -2372,12 +2419,29 @@ class DatasourceEditor extends PureComponent<
               ),
               children: (
                 <StyledTableTabWrapper>
-                  {this.renderDefaultColumnSettings()}
-                  <DefaultColumnSettingsTitle>
-                    {t('Column Settings')}
-                  </DefaultColumnSettingsTitle>
+                  <Input.Search
+                    placeholder={t('Search calculated columns by name')}
+                    value={this.state.calculatedColumnSearchTerm}
+                    onChange={e =>
+                      this.setState({
+                        calculatedColumnSearchTerm: e.target.value,
+                      })
+                    }
+                    style={{ marginBottom: 16, width: 300 }}
+                    allowClear
+                  />
                   <ColumnCollectionTable
-                    columns={this.state.calculatedColumns}
+                    columns={
+                      this.state.calculatedColumnSearchTerm
+                        ? this.state.calculatedColumns.filter(col =>
+                            col.column_name
+                              ?.toLowerCase()

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Runtime Error in Column Search Filter</b></div>
   <div id="fix">
   
   The search filter for calculated columns may throw a TypeError if any column 
has a null or undefined column_name, since optional chaining returns undefined 
which doesn't have an .includes() method. This could crash the search 
functionality when users try to filter columns.
   </div>
   
   
   <details>
   <summary>
   <b>Code suggestion</b>
   </summary>
   <blockquote>Check the AI-generated fix before applying</blockquote>
   <div id="code">
   
   
   ````suggestion
                               (col.column_name || '')
                                 .toLowerCase()
   ````
   
   </div>
   </details>
   
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #1f6ca0</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