You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ma...@apache.org on 2018/12/18 01:03:57 UTC
[incubator-superset] branch master updated: Fix string value
displaying NaN (#6534)
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 <ma...@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 =>