ktmud commented on a change in pull request #9829:
URL:
https://github.com/apache/incubator-superset/pull/9829#discussion_r426824394
##########
File path:
superset-frontend/src/explore/components/controls/FilterBoxItemControl.jsx
##########
@@ -27,6 +27,9 @@ import SelectControl from './SelectControl';
import CheckboxControl from './CheckboxControl';
import TextControl from './TextControl';
+const INTEGRAL_TYPES = ['TINYINT', 'SMALLINT', 'INT', 'INTEGER', 'BIGINT'];
+const DECIMAL_TYPES = ['FLOAT', 'DOUBLE'];
Review comment:
Can we use `Set`? It's faster than arrays.
```
const DECIMAL_TYPES = new Set(['FLOAT', 'DOUBLE'])
DECIMAL_TYPES.has(columnType)
```
Not sure what types are returned to the frontend, but are we sure these
types are exhaustive:
https://github.com/apache/incubator-superset/blob/a6cedaaa879348aca49a520793bb20e63d152a1f/superset/connectors/base/models.py#L480-L493
Might want to add `LONG` to `INTEGRAL_TYPES`; and `NUMERIC`, `NUMBER`,
`REAL` and `DECIMAL` to `DECIMAL_TYPES`, too?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]