Merge pull request #913 from nabenabe0928/debug/fix-csv-artifact-viewer

Fix an error in TableArtifactViewer when keys have an empty string
This commit is contained in:
c-bata
2024-08-01 14:34:42 +09:00
committed by GitHub
@@ -55,7 +55,8 @@ export const TableArtifactViewer: React.FC<TableArtifactViewerProps> = (
})
const keys = Array.from(unionSet)
return keys.map((key) => ({
header: key,
// ``header`` cannot be a falsy value, so replace key with a string looking like an empty string.
header: key || " ",
accessorFn: (info: Data) =>
typeof info[key] === "object" ? JSON.stringify(info[key]) : info[key],
enableSorting: true,