mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
fix(explore): Explore page boolean filter is broken for Presto DB (#14952)
* Front end update - modify OPERATORS, to have SQL operation and display value * Updated tests * More tests * Remove OPERATOR imports * Fix break tests * PR comments * fix issue with comparator loading * rename a variable * Linting
This commit is contained in:
@@ -20,7 +20,10 @@ import React, { useEffect, useMemo, useState } from 'react';
|
||||
import { logging, SupersetClient, t, Metric } from '@superset-ui/core';
|
||||
import { ColumnMeta } from '@superset-ui/chart-controls';
|
||||
import { Tooltip } from 'src/components/Tooltip';
|
||||
import { OPERATORS } from 'src/explore/constants';
|
||||
import {
|
||||
Operators,
|
||||
OPERATOR_ENUM_TO_OPERATOR_TYPE,
|
||||
} from 'src/explore/constants';
|
||||
import { OptionSortType } from 'src/explore/types';
|
||||
import {
|
||||
DndFilterSelectProps,
|
||||
@@ -191,7 +194,9 @@ export const DndFilterSelect = (props: DndFilterSelectProps) => {
|
||||
props.datasource.type === 'druid'
|
||||
? filterOptions.saved_metric_name
|
||||
: getMetricExpression(filterOptions.saved_metric_name),
|
||||
operator: OPERATORS['>'],
|
||||
operator:
|
||||
OPERATOR_ENUM_TO_OPERATOR_TYPE[Operators.GREATER_THAN].operation,
|
||||
operatorId: Operators.GREATER_THAN,
|
||||
comparator: 0,
|
||||
clause: CLAUSES.HAVING,
|
||||
});
|
||||
@@ -207,7 +212,9 @@ export const DndFilterSelect = (props: DndFilterSelectProps) => {
|
||||
props.datasource.type === 'druid'
|
||||
? filterOptions.label
|
||||
: new AdhocMetric(option).translateToSql(),
|
||||
operator: OPERATORS['>'],
|
||||
operator:
|
||||
OPERATOR_ENUM_TO_OPERATOR_TYPE[Operators.GREATER_THAN].operation,
|
||||
operatorId: Operators.GREATER_THAN,
|
||||
comparator: 0,
|
||||
clause: CLAUSES.HAVING,
|
||||
});
|
||||
@@ -217,7 +224,8 @@ export const DndFilterSelect = (props: DndFilterSelectProps) => {
|
||||
return new AdhocFilter({
|
||||
expressionType: EXPRESSION_TYPES.SIMPLE,
|
||||
subject: filterOptions.column_name,
|
||||
operator: OPERATORS['=='],
|
||||
operator: OPERATOR_ENUM_TO_OPERATOR_TYPE[Operators.EQUALS].operation,
|
||||
operatorId: Operators.EQUALS,
|
||||
comparator: '',
|
||||
clause: CLAUSES.WHERE,
|
||||
isNew: true,
|
||||
|
||||
Reference in New Issue
Block a user