Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 'argument to reversed() must be a sequence' #4237

Merged
merged 1 commit into from Jan 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion superset/viz.py
Expand Up @@ -1852,7 +1852,10 @@ def process_spatial_data_obj(self, key, df):
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)
Copy link
Member

@hughhhh hughhhh Jan 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way for us to give the user a warning about that some of the reversed values weren't converted properly?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be somewhat tricky from this context. On the JS side we can notify.warning("Foo bar") but there are no easy mechanics from this context.

for o in df[key]
]
del df[spatial.get('lonlatCol')]
elif spatial.get('type') == 'geohash':
latlong = df[spatial.get('geohashCol')].map(geohash.decode)
Expand Down