diff --git a/superset/utils.py b/superset/utils.py index 483058e78f..79b1ee4fa0 100644 --- a/superset/utils.py +++ b/superset/utils.py @@ -724,13 +724,13 @@ def to_adhoc(filt, expressionType='SIMPLE', clause='where'): if expressionType == 'SIMPLE': result.update({ - 'comparator': filt['val'], - 'operator': filt['op'], - 'subject': filt['col'], + 'comparator': filt.get('val'), + 'operator': filt.get('op'), + 'subject': filt.get('col'), }) elif expressionType == 'SQL': result.update({ - 'sqlExpression': filt[clause], + 'sqlExpression': filt.get(clause), }) return result