From 79702e105a6bb2dbaea328a172122c2370a3c7fc 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) (cherry picked from commit 6c6ea3730b91578184b57f41618979ab13d429c7) --- superset/utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/superset/utils.py b/superset/utils.py index b1583084ebbc8..518a68fb1ab01 100644 --- a/superset/utils.py +++ b/superset/utils.py @@ -723,13 +723,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