@@ -43,29 +43,24 @@ def get_snowflake_conn(config, autocommit=True) -> SnowflakeConnection:
43
43
if config .type == "snowflake.offline" :
44
44
config_header = "connections.feast_offline_store"
45
45
46
- config = dict (config )
46
+ config_dict = dict (config )
47
47
48
48
# read config file
49
49
config_reader = configparser .ConfigParser ()
50
- config_reader .read ([config ["config_path" ]])
50
+ config_reader .read ([config_dict ["config_path" ]])
51
51
if config_reader .has_section (config_header ):
52
52
kwargs = dict (config_reader [config_header ])
53
53
else :
54
54
kwargs = {}
55
55
56
- kwargs .update ((k , v ) for k , v in config .items () if v is not None )
56
+ kwargs .update ((k , v ) for k , v in config_dict .items () if v is not None )
57
+ [kwargs .update ({k : '"' + v + '"' }) for k ,v in kwargs .items () if k in ['role' , 'warehouse' , 'database' , 'schema_' ]]
57
58
58
59
try :
59
60
conn = snowflake .connector .connect (
60
- account = kwargs ["account" ],
61
- user = kwargs ["user" ],
62
- password = kwargs ["password" ],
63
- role = f'''"{ kwargs ['role' ]} "''' ,
64
- warehouse = f'''"{ kwargs ['warehouse' ]} "''' ,
65
- database = f'''"{ kwargs ['database' ]} "''' ,
66
- schema = f'''"{ kwargs ['schema_' ]} "''' ,
67
61
application = "feast" ,
68
62
autocommit = autocommit ,
63
+ ** kwargs
69
64
)
70
65
71
66
return conn
0 commit comments