From 6c6ea3730b91578184b57f41618979ab13d429c7 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Tue, 28 Aug 2018 15:26:41 -0700 Subject: [PATCH] [bugfix] IS NOT NULL filter triggers KeyError: 'val' (#5764) --- superset/utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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