[bugfix] IS NOT NULL filter triggers KeyError: 'val' (#5764)

This commit is contained in:
Maxime Beauchemin 2018-08-28 15:26:41 -07:00 committed by GitHub
parent ba4b8a033b
commit 6c6ea3730b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -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