diff --git a/flyteadmin/pkg/common/filters.go b/flyteadmin/pkg/common/filters.go index 67108ced5..dbf1ce84c 100644 --- a/flyteadmin/pkg/common/filters.go +++ b/flyteadmin/pkg/common/filters.go @@ -162,7 +162,7 @@ func (f *inlineFilterImpl) getGormQueryExpr(formattedField string) (GormQueryExp // ValueIn is special because it uses repeating values. if f.function == ValueIn { - queryStr := fmt.Sprintf(valueInQuery, f.field) + queryStr := fmt.Sprintf(valueInQuery, formattedField) return GormQueryExpr{ Query: queryStr, Args: f.repeatedValue, diff --git a/flyteadmin/pkg/common/filters_test.go b/flyteadmin/pkg/common/filters_test.go index efba8d291..f3ef11c1f 100644 --- a/flyteadmin/pkg/common/filters_test.go +++ b/flyteadmin/pkg/common/filters_test.go @@ -62,9 +62,15 @@ func TestNewSingleValueCustomizedFilter(t *testing.T) { } func TestNewRepeatedValueFilter(t *testing.T) { - _, err := NewRepeatedValueFilter(Workflow, ValueIn, "project", []string{"SuperAwesomeProject", "AnotherAwesomeProject"}) + vals := []string{"SuperAwesomeProject", "AnotherAwesomeProject"} + filter, err := NewRepeatedValueFilter(Workflow, ValueIn, "project", vals) assert.NoError(t, err) + expression, err := filter.GetGormJoinTableQueryExpr("projects") + assert.NoError(t, err) + assert.Equal(t, "projects.project in (?)", expression.Query) + assert.Equal(t, vals, expression.Args) + _, err = NewRepeatedValueFilter(Workflow, Equal, "domain", []string{"production", "qa"}) assert.EqualError(t, err, "invalid repeated value filter expression: equal") } diff --git a/flyteadmin/tests/task_execution_test.go b/flyteadmin/tests/task_execution_test.go index b81e1c264..b1bfb2cd2 100644 --- a/flyteadmin/tests/task_execution_test.go +++ b/flyteadmin/tests/task_execution_test.go @@ -283,7 +283,7 @@ func TestCreateAndListTaskExecution(t *testing.T) { NodeExecutionId: nodeExecutionId, Limit: 10, Filters: "eq(task.project, project)+eq(task.domain, development)+eq(task.name, task name)+" + - "eq(task.version, task version)+eq(task_execution.retry_attempt, 1)", + "eq(task.version, task version)+eq(task_execution.retry_attempt, 1)+value_in(phase, RUNNING)", }) assert.Len(t, response.TaskExecutions, 1) assert.Nil(t, err)