Skip to content

Commit beb01c7

Browse files
fix: change EnforceNetworkRulesForInternalStages ddl to parameter (#3343)
<!-- Feel free to delete comments as you fill this in --> <!-- summary of changes --> `ENFORCE_NETWORK_RULES_FOR_INTERNAL_STAGES` requires boolean parameter so I change the setting from ddl:keyword to ddl:parameter. ## Test Plan <!-- detail ways in which this PR has been tested or needs to be tested --> * [ ] acceptance tests <!-- add more below if you think they are relevant --> * [ ] … ## References <!-- issues documentation links, etc --> #3344 Co-authored-by: Jakub Michalak <[email protected]>
1 parent 1642c15 commit beb01c7

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

pkg/sdk/parameters.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,7 @@ type AccountParameters struct {
11861186
EnableTriSecretAndRekeyOptOutForImageRepository *bool `ddl:"parameter" sql:"ENABLE_TRI_SECRET_AND_REKEY_OPT_OUT_FOR_IMAGE_REPOSITORY"`
11871187
EnableTriSecretAndRekeyOptOutForSpcsBlockStorage *bool `ddl:"parameter" sql:"ENABLE_TRI_SECRET_AND_REKEY_OPT_OUT_FOR_SPCS_BLOCK_STORAGE"`
11881188
EnableUnhandledExceptionsReporting *bool `ddl:"parameter" sql:"ENABLE_UNHANDLED_EXCEPTIONS_REPORTING"`
1189-
EnforceNetworkRulesForInternalStages *bool `ddl:"keyword" sql:"ENFORCE_NETWORK_RULES_FOR_INTERNAL_STAGES"`
1189+
EnforceNetworkRulesForInternalStages *bool `ddl:"parameter" sql:"ENFORCE_NETWORK_RULES_FOR_INTERNAL_STAGES"`
11901190
EventTable *string `ddl:"parameter,single_quotes" sql:"EVENT_TABLE"`
11911191
ExternalOAuthAddPrivilegedRolesToBlockedList *bool `ddl:"parameter" sql:"EXTERNAL_OAUTH_ADD_PRIVILEGED_ROLES_TO_BLOCKED_LIST"`
11921192
// InitialReplicationSizeLimitInTB is a string because values like 3.0 get rounded to 3, resulting in an error in Snowflake.

pkg/sdk/parameters_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,21 @@ func TestUnSetObjectParameterNetworkPolicyOnUser(t *testing.T) {
5454
})
5555
}
5656

57+
func TestSetAccountParameterEnforceNetworkRulesForInternalStages(t *testing.T) {
58+
opts := &AlterAccountOptions{
59+
Set: &AccountSet{
60+
Parameters: &AccountLevelParameters{
61+
AccountParameters: &AccountParameters{
62+
EnforceNetworkRulesForInternalStages: Bool(true),
63+
},
64+
},
65+
},
66+
}
67+
t.Run("Set Enforce Network Rules for Internal Stages", func(t *testing.T) {
68+
assertOptsValidAndSQLEquals(t, opts, "ALTER ACCOUNT SET ENFORCE_NETWORK_RULES_FOR_INTERNAL_STAGES = true")
69+
})
70+
}
71+
5772
func TestToAccountParameter(t *testing.T) {
5873
type test struct {
5974
input string

0 commit comments

Comments
 (0)