diff --git a/core/asset/type.go b/core/asset/type.go index 44d17af4..ea78f2c2 100644 --- a/core/asset/type.go +++ b/core/asset/type.go @@ -8,6 +8,7 @@ const ( TypeFeatureTable Type = "feature_table" TypeApplication Type = "application" TypeModel Type = "model" + TypeQuery Type = "query" ) // AllSupportedTypes holds a list of all supported types struct @@ -19,6 +20,7 @@ var AllSupportedTypes = []Type{ TypeFeatureTable, TypeApplication, TypeModel, + TypeQuery, } // Type specifies a supported type name @@ -33,7 +35,7 @@ func (t Type) String() string { func (t Type) IsValid() bool { switch t { case TypeTable, TypeJob, TypeDashboard, TypeTopic, - TypeFeatureTable, TypeApplication, TypeModel: + TypeFeatureTable, TypeApplication, TypeModel, TypeQuery: return true } return false diff --git a/core/asset/type_test.go b/core/asset/type_test.go index 751637fb..1034e53c 100644 --- a/core/asset/type_test.go +++ b/core/asset/type_test.go @@ -15,6 +15,7 @@ func TestTypeString(t *testing.T) { TypeFeatureTable: "feature_table", TypeApplication: "application", TypeModel: "model", + TypeQuery: "query", } { t.Run((string)(typ), func(t *testing.T) { assert.Equal(t, expected, typ.String()) @@ -24,7 +25,7 @@ func TestTypeString(t *testing.T) { func TestTypeIsValid(t *testing.T) { for _, typ := range []Type{ - "dashboard", "job", "table", "topic", "feature_table", "application", "model", + "dashboard", "job", "table", "topic", "feature_table", "application", "model", "query", } { t.Run((string)(typ), func(t *testing.T) { assert.Truef(t, typ.IsValid(), "%s should be valid", typ) diff --git a/internal/server/v1beta1/type_test.go b/internal/server/v1beta1/type_test.go index 4149bcad..8619d553 100644 --- a/internal/server/v1beta1/type_test.go +++ b/internal/server/v1beta1/type_test.go @@ -86,6 +86,10 @@ func TestGetTypes(t *testing.T) { Name: "model", Count: 0, }, + { + Name: "query", + Count: 0, + }, }, }