Table View: unsupported operand type(s) for +: 'NoneType' and 'str'
Make sure these boxes are checked before submitting your issue - thank you!
- [x] I have checked the superset logs for python stacktraces and included it here as text if any
- [x] I have reproduced the issue with at least the latest released version of superset
- [x] I have checked the issue tracker for the same issue and I haven't found one similar
Superset version
0.22.1
Expected results
I would expect to see the table when the slice is included in a dashboard, any dashboard
Actual results
Instead I have the following message:
unsupported operand type(s) for +: 'NoneType' and 'str'
Steps to reproduce
I don't know what is so special about this table view. Other table views work perfectly fine, but for this one even when I change all the options (with group keys or without, with "Include Time" option or without, with sorting or without) nothing changes: the slice seems to work fine when editing, but inside a dashboard I get the error.
Stacktrace:
Dec 11 16:22:32 scl[15363]: Traceback (most recent call last):
Dec 11 16:22:32 scl[15363]: File "/home/superset-server/venvs/sss-superset-py3/lib/python3.5/site-packages/superset/views/core.py", line 1083, in explore_json
Dec 11 16:22:32 scl[15363]: force=request.args.get('force') == 'true')
Dec 11 16:22:32 scl[15363]: File "/home/superset-server/venvs/sss-superset-py3/lib/python3.5/site-packages/superset/viz.py", line 248, in get_payload
Dec 11 16:22:32 scl[15363]: cache_key = self.cache_key
Dec 11 16:22:32 scl[15363]: File "/home/superset-server/venvs/sss-superset-py3/lib/python3.5/site-packages/superset/viz.py", line 225, in cache_key
Dec 11 16:22:32 scl[15363]: merge_extra_filters(form_data)
Dec 11 16:22:32 scl[15363]: File "/home/superset-server/venvs/sss-superset-py3/lib/python3.5/site-packages/superset/utils.py", line 719, in merge_extra_filters
Dec 11 16:22:32 scl[15363]: existing_filters[get_filter_key(existing)] = existing['val']
Dec 11 16:22:32 scl[15363]: File "/home/superset-server/venvs/sss-superset-py3/lib/python3.5/site-packages/superset/utils.py", line 716, in get_filter_key
Dec 11 16:22:32 scl[15363]: return f['col'] + '__' + f['op']
Dec 11 16:22:32 scl[15363]: TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
The reason comes from the PR #3668, right here https://github.com/apache/incubator-superset/blame/af7cdeba4d7eb38c51467a5987b2b3321cf23c69/superset/utils.py#L734-L735
This assumes f['col'] is not None.
The previous version, https://github.com/apache/incubator-superset/blame/83e6807fa01c15d545244493920fb63a74a941f0/superset/utils.py#L687-L692, made no such assumption.
I'll propose a fix