superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject [incubator-superset] branch master updated: Fix string value displaying NaN (#6534)
Date Tue, 18 Dec 2018 01:03:57 GMT
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 95cdda4  Fix string value displaying NaN (#6534)
95cdda4 is described below

commit 95cdda4482c76b9bb6578fbe8862c8b0b1421787
Author: Mars <mars914@126.com>
AuthorDate: Tue Dec 18 09:03:51 2018 +0800

    Fix string value displaying NaN (#6534)
---
 superset/assets/src/visualizations/Table/Table.js | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/superset/assets/src/visualizations/Table/Table.js b/superset/assets/src/visualizations/Table/Table.js
index 23cdc07..e8742af 100644
--- a/superset/assets/src/visualizations/Table/Table.js
+++ b/superset/assets/src/visualizations/Table/Table.js
@@ -174,7 +174,15 @@ function TableVis(element, props) {
       return null;
     })
     .classed('text-right', d => d.isMetric)
-    .attr('title', d => (!Number.isNaN(d.val) ? formatValue(d.val) : null))
+    .attr('title', (d) => {
+      if (typeof d.val === 'string') {
+        return d.val;
+      }
+      if (!Number.isNaN(d.val)) {
+        return formatValue(d.val);
+      }
+      return null;
+    })
     .attr('data-sort', d => (d.isMetric) ? d.val : null)
     // Check if the dashboard currently has a filter for each row
     .classed('filtered', d =>


Mime
View raw message