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 'argument to reversed() must be a sequence' (#4237)
Date Thu, 18 Jan 2018 23:22:24 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 36caca3  Fix 'argument to reversed() must be a sequence' (#4237)
36caca3 is described below

commit 36caca32442e121453ea7e4a68b63fc95742a0aa
Author: Maxime Beauchemin <maximebeauchemin@gmail.com>
AuthorDate: Thu Jan 18 15:22:22 2018 -0800

    Fix 'argument to reversed() must be a sequence' (#4237)
    
    When passing empty/null location data out of certain rows in the spatial
    control, Superset raises an error when trying to reverse the tuple.
---
 superset/viz.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/superset/viz.py b/superset/viz.py
index 165d4a1..6db51a1 100644
--- a/superset/viz.py
+++ b/superset/viz.py
@@ -1852,7 +1852,10 @@ class BaseDeckGLViz(BaseViz):
         elif spatial.get('type') == 'delimited':
             df[key] = (df[spatial.get('lonlatCol')].str.split(spatial.get('delimiter')))
             if spatial.get('reverseCheckbox'):
-                df[key] = [list(reversed(item))for item in df[key]]
+                df[key] = [
+                    tuple(reversed(o)) if isinstance(o, (list, tuple)) else (0, 0)
+                    for o in df[key]
+                ]
             del df[spatial.get('lonlatCol')]
         elif spatial.get('type') == 'geohash':
             latlong = df[spatial.get('geohashCol')].map(geohash.decode)

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

Mime
View raw message