diff --git a/superset/assets/src/explore/AdhocFilter.js b/superset/assets/src/explore/AdhocFilter.js index dfaef55209387..dc3599c2017d3 100644 --- a/superset/assets/src/explore/AdhocFilter.js +++ b/superset/assets/src/explore/AdhocFilter.js @@ -21,6 +21,8 @@ const OPERATORS_TO_SQL = { 'not in': 'not in', LIKE: 'like', regex: 'regex', + 'IS NOT NULL': 'IS NOT NULL', + 'IS NULL': 'IS NULL', }; function translateToSql(adhocMetric, { useSimple } = {}) { @@ -84,6 +86,13 @@ export default class AdhocFilter { isValid() { if (this.expressionType === EXPRESSION_TYPES.SIMPLE) { + if (this.operator === 'IS NOT NULL' || this.operator === 'IS NULL') { + return !!( + this.operator && + this.subject + ); + } + return !!( this.operator && this.subject && diff --git a/superset/assets/src/explore/components/AdhocFilterEditPopoverSimpleTabContent.jsx b/superset/assets/src/explore/components/AdhocFilterEditPopoverSimpleTabContent.jsx index 222772a464bf3..94535cdea79e9 100644 --- a/superset/assets/src/explore/components/AdhocFilterEditPopoverSimpleTabContent.jsx +++ b/superset/assets/src/explore/components/AdhocFilterEditPopoverSimpleTabContent.jsx @@ -274,6 +274,7 @@ export default class AdhocFilterEditPopoverSimpleTabContent extends React.Compon showHeader={false} noResultsText={t('type a value here')} refFunc={this.multiComparatorRef} + disabled={adhocFilter.operator === 'IS NOT NULL' || adhocFilter.operator === 'IS NULL'} /> :