Skip to content

Commit

Permalink
Fixes datatable crash when dimension is empty (apache#20680)
Browse files Browse the repository at this point in the history
Fixes apache#20679

Co-authored-by: Usiel Riedl <[email protected]>
(cherry picked from commit 19247cc)
  • Loading branch information
Usiel authored and Lily Kuang committed Feb 23, 2023
1 parent 40f111f commit f4f6869
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,9 @@ export const useTableColumns = (
const isOriginalTimeColumn =
originalFormattedTimeColumns.includes(key);
return {
id: key,
// react-table requires a non-empty id, therefore we introduce a fallback value in case the key is empty
id: key || index,
accessor: row => row[key],
// When the key is empty, have to give a string of length greater than 0
Header:
colType === GenericDataType.TEMPORAL &&
typeof firstValue !== 'string' ? (
Expand Down

0 comments on commit f4f6869

Please sign in to comment.