File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
kedro-datasets/kedro_datasets/ibis Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -140,11 +140,17 @@ def __init__( # noqa: PLR0913
140
140
141
141
self ._table_name = table_name
142
142
self ._database = database
143
- # Prefer credentials if provided, else fallback to connection
143
+ # Prefer credentials if provided, else fallback to connection.
144
+ # Ensure _connection_config is always a dict[str, Any] for type stability.
145
+ self ._connection_config : dict [str , Any ]
144
146
if credentials is not None :
145
- self ._connection_config = credentials
147
+ if isinstance (credentials , str ):
148
+ # Treat string credentials as a connection string under key 'con'
149
+ self ._connection_config = {"con" : credentials }
150
+ else :
151
+ self ._connection_config = deepcopy (credentials )
146
152
else :
147
- self ._connection_config = connection or self .DEFAULT_CONNECTION_CONFIG
153
+ self ._connection_config = deepcopy ( connection or self .DEFAULT_CONNECTION_CONFIG )
148
154
self .metadata = metadata
149
155
150
156
# Set load and save arguments, overwriting defaults if provided.
You can’t perform that action at this time.
0 commit comments