Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-ext-simba-jy committed Oct 3, 2024
1 parent 4a2d819 commit cd0beeb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
11 changes: 5 additions & 6 deletions connection_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ func loadConnectionConfig() (*Config, error) {
if err != nil {
return nil, err
}
err = fillMissingConfigParameters(cfg)
if err != nil {
return nil, err
}

Check warning on line 64 in connection_configuration.go

View check run for this annotation

Codecov / codecov/patch

connection_configuration.go#L63-L64

Added lines #L63 - L64 were not covered by tests
return cfg, err
}

Expand All @@ -74,11 +78,6 @@ func parseToml(cfg *Config, connection map[string]interface{}) error {
}
cfg.Token = v

Check warning on line 79 in connection_configuration.go

View check run for this annotation

Codecov / codecov/patch

connection_configuration.go#L75-L79

Added lines #L75 - L79 were not covered by tests
}

err := fillMissingConfigParameters(cfg)
if err != nil {
return err
}
return nil
}

Expand Down Expand Up @@ -319,7 +318,7 @@ func validateFilePermission(filePath string) error {
return err
}
if permission := fileInfo.Mode().Perm(); permission != os.FileMode(0600) {
return err := &SnowflakeError{
return &SnowflakeError{
Number: ErrCodeInvalidFilePermission,
Message: errMsgInvalidPermissionToTomlFile,
MessageArgs: []interface{}{permission},
Expand Down
7 changes: 7 additions & 0 deletions test_data/connections.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,12 @@ testNot = 'problematicParameter'
token_file_path = '/Users/test/.snowflake/token'

[read-token]
account = 'snowdriverswarsaw.us-west-2.aws'
user = 'test_default_user'
password = 'test_default_pass'
warehouse = 'testw_default'
database = 'test_default_db'
schema = 'test_default_go'
protocol = 'https'
authenticator = 'oauth'
token_file_path = './test_data/snowflake/session/token'

0 comments on commit cd0beeb

Please sign in to comment.