diff --git a/pkg/resources/grant_privileges_to_database_role_acceptance_test.go b/pkg/resources/grant_privileges_to_database_role_acceptance_test.go index 0b69ffe49a0..c901dc3c706 100644 --- a/pkg/resources/grant_privileges_to_database_role_acceptance_test.go +++ b/pkg/resources/grant_privileges_to_database_role_acceptance_test.go @@ -221,7 +221,8 @@ func TestAcc_GrantPrivilegesToDatabaseRole_OnFutureSchemasInDatabase(t *testing. resource.TestCheckResourceAttr(resourceName, "privileges.0", string(sdk.SchemaPrivilegeCreateTable)), resource.TestCheckResourceAttr(resourceName, "privileges.1", string(sdk.SchemaPrivilegeModify)), resource.TestCheckResourceAttr(resourceName, "on_schema.#", "1"), - resource.TestCheckResourceAttr(resourceName, "on_schema.0.future_schemas_in_database", databaseName), resource.TestCheckResourceAttr(resourceName, "with_grant_option", "false"), + resource.TestCheckResourceAttr(resourceName, "on_schema.0.future_schemas_in_database", databaseName), + resource.TestCheckResourceAttr(resourceName, "with_grant_option", "false"), resource.TestCheckResourceAttr(resourceName, "id", fmt.Sprintf("%s|false|false|CREATE TABLE,MODIFY|OnSchema|OnFutureSchemasInDatabase|%s", databaseRoleName, databaseName)), ), }, diff --git a/pkg/resources/grant_privileges_to_database_role_identifier.go b/pkg/resources/grant_privileges_to_database_role_identifier.go index 97a663ac4a6..bc66bd36f3e 100644 --- a/pkg/resources/grant_privileges_to_database_role_identifier.go +++ b/pkg/resources/grant_privileges_to_database_role_identifier.go @@ -131,6 +131,8 @@ func ParseGrantPrivilegesToDatabaseRoleId(id string) (GrantPrivilegesToDatabaseR return databaseRoleId, sdk.NewError(`database role identifier should hold at least 5 parts "|||||"`) } + // TODO: Identifier parsing should be replaced with better version introduced in SNOW-999049. + // Right now, it's same as sdk.NewDatabaseObjectIdentifierFromFullyQualifiedName, but with error handling. databaseRoleNameParts := strings.Split(parts[0], ".") if len(databaseRoleNameParts) == 0 || (len(databaseRoleNameParts) == 1 && databaseRoleNameParts[0] == "") || diff --git a/pkg/sdk/parameters_test.go b/pkg/sdk/parameters_test.go index d1a2de57c83..876290a4bd6 100644 --- a/pkg/sdk/parameters_test.go +++ b/pkg/sdk/parameters_test.go @@ -1,7 +1,6 @@ package sdk import ( - "log" "testing" ) @@ -23,19 +22,3 @@ func TestSetObjectParameterOnObject(t *testing.T) { assertOptsValidAndSQLEquals(t, opts, "ALTER USER %s SET ENABLE_UNREDACTED_QUERY_SYNTAX_ERROR = TRUE", id.FullyQualifiedName()) }) } - -func (o ObjectType) Check() bool { - var m map[ObjectType]bool - if _, ok := m[o]; ok { - return true - } - return false -} - -func Test(t *testing.T) { - a := "abc" - b := ObjectTypeDatabase - - log.Println(ObjectType(a).Check()) - log.Println(b.Check()) -}