-
Notifications
You must be signed in to change notification settings - Fork 427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add allowed values #1006
feat: add allowed values #1006
Conversation
@@ -256,6 +273,16 @@ func ReadTag(d *schema.ResourceData, meta interface{}) error { | |||
return err | |||
} | |||
|
|||
av := strings.ReplaceAll(t.AllowedValues.String, "\"", "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this still work if someone wants a tag value like foo[bar]
? instead of re-writing a partial parser, can we re-use an existing helper function?
} | ||
d := schema.TestResourceDataRaw(t, resources.Tag().Schema, in) | ||
r.NotNil(d) | ||
|
||
WithMockDb(t, func(db *sql.DB, mock sqlmock.Sqlmock) { | ||
mock.ExpectExec( | ||
`^CREATE TAG "test_db"."test_schema"."good_name" COMMENT = 'great comment'$`, | ||
`^CREATE TAG "test_db"."test_schema"."good_name" ALLOWED_VALUES 'marketing', 'finance' COMMENT = 'great comment'$`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add test case like CREATE OR REPLACE TAG test."foo[bar]" ALLOWED_VALUES '1', '2["3"]';
Updating with latest changes and removing conflict
/ok-to-test sha=92c16cc |
/ok-to-test sha=92c16cc |
Integration tests failure for 92c16cc |
error during integration test. can you please verify this test case passes and then push a commit to fix? |
/ok-to-test sha=1ffdd57 |
Integration tests success for 1ffdd57 |
Added allowed_values attribute to snowflake_tag resource
Test Plan
References
issue link: #815