File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -190,6 +190,11 @@ def set_grpc_keep_alive_timeout(self, timeout):
190
190
self .grpc_keep_alive_timeout = timeout
191
191
return self
192
192
193
+ def _update_attrs_by_kwargs (self , kwargs : dict ):
194
+ for key , value in kwargs .items ():
195
+ if getattr (self , key ) is None :
196
+ setattr (self , key , value )
197
+
193
198
194
199
ConnectionParams = DriverConfig
195
200
@@ -215,17 +220,12 @@ def get_config(
215
220
)
216
221
return driver_config
217
222
218
- if driver_config .endpoint is None and endpoint is not None :
219
- driver_config .endpoint = endpoint
220
-
221
- if driver_config .database is None and database is not None :
222
- driver_config .database = database
223
-
224
- if driver_config .credentials is None and credentials is not None :
225
- driver_config .credentials = credentials
223
+ kwargs ['endpoint' ] = endpoint
224
+ kwargs ['database' ] = database
225
+ kwargs ['root_certificates' ] = root_certificates
226
+ kwargs ['credentials' ] = credentials
226
227
227
- if driver_config .root_certificates is None and root_certificates is not None :
228
- driver_config .root_certificates = root_certificates
228
+ driver_config ._update_attrs_by_kwargs (kwargs )
229
229
230
230
return driver_config
231
231
You can’t perform that action at this time.
0 commit comments