Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

fix: make all filter operators uppercase #378

Merged
merged 3 commits into from
Apr 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/superset-ui-query/src/types/Operator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
const UNARY_OPERATORS = ['IS NOT NULL', 'IS NULL'] as const;

/** List of operators that require another operand that is a single value */
const BINARY_OPERATORS = ['=', '!=', '>', '<', '>=', '<=', 'like', 'regex'] as const;
const BINARY_OPERATORS = ['=', '!=', '>', '<', '>=', '<=', 'LIKE', 'REGEX'] as const;

/** List of operators that require another operand that is a set */
const SET_OPERATORS = ['in', 'not in'] as const;
const SET_OPERATORS = ['IN', 'NOT IN'] as const;

//---------------------------------------------------
// Derived types
Expand Down
4 changes: 2 additions & 2 deletions packages/superset-ui-query/test/convertFilter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ describe('convertFilter', () => {
expressionType: 'SIMPLE',
clause: 'WHERE',
subject: 'toppings',
operator: 'in',
operator: 'IN',
comparator: ['boba', 'grass jelly'],
}),
).toEqual({
col: 'toppings',
op: 'in',
op: 'IN',
val: ['boba', 'grass jelly'],
});
});
Expand Down
2 changes: 1 addition & 1 deletion packages/superset-ui-query/test/types/Filter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('Filter type guards', () => {
expressionType: 'SIMPLE',
clause: 'WHERE',
subject: 'tea',
operator: 'in',
operator: 'IN',
comparator: ['hojicha', 'earl grey'],
}),
).toEqual(true);
Expand Down