bito-code-review[bot] commented on code in PR #37396:
URL: https://github.com/apache/superset/pull/37396#discussion_r3348119076
##########
superset-frontend/src/explore/components/DataTablesPane/components/useGridResultTable.tsx:
##########
@@ -37,7 +37,7 @@ export function useGridColumns(
.filter((column: string) => Object.keys(data[0]).includes(column))
.map((key, index) => {
const colType = coltypes?.[index];
- const headerLabel = columnDisplayNames?.[key] ?? key;
+ const headerLabel = collabels?.[index];
Review Comment:
<!-- Bito Reply -->
The concern regarding index misalignment is valid. When columns are
filtered, the index of the remaining columns no longer corresponds to the
original `collabels` array, which is indexed by the full column set. To resolve
this, you should map the current column key to its original index or use a
lookup table that accounts for the filtered state, similar to the approach used
in `useTableColumns`.
**superset-frontend/src/explore/components/DataTablesPane/components/useGridResultTable.tsx**
```
const colType = coltypes?.[index];
const headerLabel = collabels?.[index] ?? key;
```
--
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]