From d692b8b723d723f713ab312740beec0b99554133 Mon Sep 17 00:00:00 2001 From: Grace Guo Date: Fri, 11 Feb 2022 12:41:37 -0800 Subject: [PATCH] fix: revert handle null values in time-series table --- .../src/visualizations/TimeTable/TimeTable.jsx | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/superset-frontend/src/visualizations/TimeTable/TimeTable.jsx b/superset-frontend/src/visualizations/TimeTable/TimeTable.jsx index adef1833f3298..b02eb985a0abc 100644 --- a/superset-frontend/src/visualizations/TimeTable/TimeTable.jsx +++ b/superset-frontend/src/visualizations/TimeTable/TimeTable.jsx @@ -192,17 +192,14 @@ const TimeTable = ({ } else { v = reversedEntries[timeLag][valueField]; } - if (typeof v === 'number' || typeof recent === 'number') { - if (column.comparisonType === 'diff') { - v = recent - v; - } else if (column.comparisonType === 'perc') { - v = recent / v; - } else if (column.comparisonType === 'perc_change') { - v = recent / v - 1; - } - } else { - v = 'N/A'; + if (column.comparisonType === 'diff') { + v = recent - v; + } else if (column.comparisonType === 'perc') { + v = recent / v; + } else if (column.comparisonType === 'perc_change') { + v = recent / v - 1; } + v = v || 0; } else if (column.colType === 'contrib') { // contribution to column total v =