Skip to content

Commit

Permalink
fix braces with nulls
Browse files Browse the repository at this point in the history
  • Loading branch information
vogievetsky committed May 16, 2024
1 parent b718b1f commit 7d4149c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions web-console/src/utils/table-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ export function getNumericColumnBraces(
queryResult.header.forEach((column, i) => {
if (!oneOf(column.nativeType, 'LONG', 'FLOAT', 'DOUBLE')) return;
const formatter = columnHints?.get(column.name)?.formatter || formatNumber;
const brace = filterMap(rows, row =>
const braces = filterMap(rows, row =>
oneOf(typeof row[i], 'number', 'bigint') ? formatter(row[i]) : undefined,
);
if (rows.length === brace.length) {
numericColumnBraces[i] = brace;
if (braces.length) {
numericColumnBraces[i] = braces;
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ export const ResultTablePane = React.memo(function ResultTablePane(props: Result
{numericColumnBraces[i] ? (
<BracedText
className="table-padding"
text={formatNumber(value)}
text={typeof value === 'number' ? formatNumber(value) : String(value)}
braces={numericColumnBraces[i]}
padFractionalPart
/>
Expand Down

0 comments on commit 7d4149c

Please sign in to comment.