From 36caca32442e121453ea7e4a68b63fc95742a0aa Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Thu, 18 Jan 2018 15:22:22 -0800 Subject: [PATCH] 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 165d4a1e64..6db51a1f50 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)