fix(explore): Dashboard filters on adhoc cols not working in Explore (#23239)

This commit is contained in:
Kamil Gabryjelski
2023-03-01 15:45:00 +01:00
committed by GitHub
parent 5a099e0762
commit 6076457b90
23 changed files with 221 additions and 121 deletions

View File

@@ -129,6 +129,15 @@ const getDashboardFormData = (overrides: JsonObject = {}) => ({
op: '<=',
val: 10000,
},
{
col: {
sqlExpression: 'totally viable sql expression',
expressionType: 'SQL',
label: 'My column',
},
op: 'IN',
val: ['Value1', 'Value2'],
},
],
granularity_sqla: 'ds',
time_range: 'Last month',
@@ -179,6 +188,7 @@ const getExpectedResultFormData = (overrides: JsonObject = {}) => ({
clause: 'WHERE',
expressionType: 'SIMPLE',
operator: 'IN',
operatorId: 'IN',
subject: 'name',
comparator: ['Aaron'],
isExtra: true,
@@ -188,11 +198,19 @@ const getExpectedResultFormData = (overrides: JsonObject = {}) => ({
clause: 'WHERE',
expressionType: 'SIMPLE',
operator: '<=',
operatorId: 'LESS_THAN_OR_EQUAL',
subject: 'num_boys',
comparator: 10000,
isExtra: true,
filterOptionName: expect.any(String),
},
{
clause: 'WHERE',
expressionType: 'SQL',
sqlExpression: `(totally viable sql expression) IN ('Value1', 'Value2')`,
filterOptionName: expect.any(String),
isExtra: true,
},
],
adhoc_filters_b: [
{
@@ -208,6 +226,7 @@ const getExpectedResultFormData = (overrides: JsonObject = {}) => ({
clause: 'WHERE',
expressionType: 'SIMPLE',
operator: 'IN',
operatorId: 'IN',
subject: 'name',
comparator: ['Aaron'],
isExtra: true,
@@ -217,11 +236,19 @@ const getExpectedResultFormData = (overrides: JsonObject = {}) => ({
clause: 'WHERE',
expressionType: 'SIMPLE',
operator: '<=',
operatorId: 'LESS_THAN_OR_EQUAL',
subject: 'num_boys',
comparator: 10000,
isExtra: true,
filterOptionName: expect.any(String),
},
{
clause: 'WHERE',
expressionType: 'SQL',
sqlExpression: `(totally viable sql expression) IN ('Value1', 'Value2')`,
filterOptionName: expect.any(String),
isExtra: true,
},
],
applied_time_extras: {
__time_grain: 'P1D',
@@ -282,6 +309,15 @@ const getExpectedResultFormData = (overrides: JsonObject = {}) => ({
op: '<=',
val: 10000,
},
{
col: {
expressionType: 'SQL',
label: 'My column',
sqlExpression: 'totally viable sql expression',
},
op: 'IN',
val: ['Value1', 'Value2'],
},
],
granularity_sqla: 'ds',
time_range: 'Last month',