mirror of
https://github.com/valitydev/redash.git
synced 2024-11-07 01:25:16 +00:00
Remove builtins invalid in Python 3 from Python runner (#4375)
These few builtins were available in Python 2.7 but not anymore in Python 3, making the runner fail to start.
This commit is contained in:
parent
5de291a98d
commit
f5a40827aa
@ -39,10 +39,10 @@ class Python(BaseQueryRunner):
|
||||
should_annotate_query = False
|
||||
|
||||
safe_builtins = (
|
||||
'sorted', 'reversed', 'map', 'reduce', 'any', 'all',
|
||||
'sorted', 'reversed', 'map', 'any', 'all',
|
||||
'slice', 'filter', 'len', 'next', 'enumerate',
|
||||
'sum', 'abs', 'min', 'max', 'round', 'cmp', 'divmod',
|
||||
'str', 'unicode', 'int', 'float', 'complex',
|
||||
'sum', 'abs', 'min', 'max', 'round', 'divmod',
|
||||
'str', 'int', 'float', 'complex',
|
||||
'tuple', 'set', 'list', 'dict', 'bool',
|
||||
)
|
||||
|
||||
@ -261,7 +261,7 @@ class Python(BaseQueryRunner):
|
||||
# One option is to use ETA with Celery + timeouts on workers
|
||||
# And replacement of worker process every X requests handled.
|
||||
|
||||
exec((code), restricted_globals, self._script_locals)
|
||||
exec(code, restricted_globals, self._script_locals)
|
||||
|
||||
result = self._script_locals['result']
|
||||
result['log'] = self._custom_print.lines
|
||||
|
Loading…
Reference in New Issue
Block a user