File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -264,24 +264,24 @@ def init(cursor: duckdb.DuckDBPyConnection) -> None:
264
264
)
265
265
try :
266
266
if isinstance (path_options , DuckDBAttachOptions ):
267
- if path_options .type == "motherduck" :
268
- continue
269
267
query = path_options .to_sql (alias )
270
268
else :
271
269
query = f"ATTACH '{ path_options } '"
272
270
if not path_options .startswith ("md:" ):
273
271
query += f" AS { alias } "
274
- else :
275
- continue
276
272
cursor .execute (query )
277
273
except BinderException as e :
278
274
# If a user tries to create a catalog pointing at `:memory:` and with the name `memory`
279
275
# then we don't want to raise since this happens by default. They are just doing this to
280
276
# set it as the default catalog.
277
+ # If a user tried to attach a MotherDuck database/share which has already by attached via
278
+ # `ATTACH 'md:'`, then we don't want to raise since this is expected.
281
279
if not (
282
280
'database with name "memory" already exists' in str (e )
283
281
and path_options == ":memory:"
284
- ) and not (f'database with name "{ alias } " already exists' in str (e )):
282
+ ) and not (
283
+ f'database with name "{ alias } " already exists' in str (e )
284
+ ):
285
285
raise e
286
286
if i == 0 and not getattr (self , "database" , None ):
287
287
cursor .execute (f"USE { alias } " )
You can’t perform that action at this time.
0 commit comments