raghavyadav01 commented on code in PR #14245: URL: https://github.com/apache/pinot/pull/14245#discussion_r1803538115
########## pinot-controller/src/main/resources/app/components/Table.tsx: ########## @@ -462,8 +471,17 @@ export default function CustomizedTables({ {styleCell(cellData.value)} </Tooltip> ); - } else { + } else if(has(cellData, 'value') && cellData.value) { return styleCell(cellData.value); + } else { + try { + const stringifiedJSON = JSON.stringify(cellData) + return stringifiedJSON + } catch(e) { + // If the data is corrupted and not recognizable by JSON.stringify, fallback to below error message instead + // of crashing the whole page for the user. + return 'Error parsing data' Review Comment: Should we say Error parsing response? ########## pinot-controller/src/main/resources/app/components/Table.tsx: ########## @@ -462,8 +471,17 @@ export default function CustomizedTables({ {styleCell(cellData.value)} </Tooltip> ); - } else { + } else if(has(cellData, 'value') && cellData.value) { return styleCell(cellData.value); + } else { + try { + const stringifiedJSON = JSON.stringify(cellData) + return stringifiedJSON + } catch(e) { + // If the data is corrupted and not recognizable by JSON.stringify, fallback to below error message instead + // of crashing the whole page for the user. + return 'Error parsing data' Review Comment: We do have JSON datatype column does that handle parsing error? If yes, we can use the similar message. ########## pinot-controller/src/main/resources/app/interfaces/types.d.ts: ########## @@ -28,8 +28,10 @@ declare module 'Models' { customRenderer: JSX.Element } + export type MapRecord = Record<string, string | number> Review Comment: @esakkiraj In the future it would change to other value type as well. Should we make it generic? -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org