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: [bugfix] fix bar order (#3180)
Date Wed, 26 Jul 2017 16:22:05 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 fca982c  [bugfix] fix bar order (#3180)
fca982c is described below

commit fca982c609571876a87ca3ccd8627dc4bc6c8726
Author: Maxime Beauchemin <maximebeauchemin@gmail.com>
AuthorDate: Wed Jul 26 09:22:03 2017 -0700

    [bugfix] fix bar order (#3180)
---
 superset/assets/javascripts/modules/utils.js | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/superset/assets/javascripts/modules/utils.js b/superset/assets/javascripts/modules/utils.js
index 7349dbb..61949c7 100644
--- a/superset/assets/javascripts/modules/utils.js
+++ b/superset/assets/javascripts/modules/utils.js
@@ -229,14 +229,10 @@ export function initJQueryAjax() {
 }
 
 export function tryNumify(s) {
-  // Attempts casting to float, returns string when failing
-  try {
-    const parsed = parseFloat(s);
-    if (parsed) {
-      return parsed;
-    }
-  } catch (e) {
-    // pass
+  // Attempts casting to Number, returns string when failing
+  const n = Number(s);
+  if (isNaN(n)) {
+    return s;
   }
-  return s;
+  return n;
 }

-- 
To stop receiving notification emails like this one, please contact
['"commits@superset.apache.org" <commits@superset.apache.org>'].

Mime
View raw message