@@ -489,21 +489,23 @@ def test_duckdb_multiple_secrets(mock_connect, make_config):
489
489
cursor = config .create_engine_adapter ().cursor
490
490
491
491
execute_calls = [call [0 ][0 ] for call in mock_cursor .execute .call_args_list ]
492
- create_secret_calls = [call for call in execute_calls if call .startswith ("CREATE SECRET" )]
492
+ create_secret_calls = [
493
+ call for call in execute_calls if call .startswith ("CREATE OR REPLACE SECRET" )
494
+ ]
493
495
494
496
# Should have exactly 2 CREATE SECRET calls
495
497
assert len (create_secret_calls ) == 2
496
498
497
499
# Verify the SQL for the first secret (S3)
498
500
assert (
499
501
create_secret_calls [0 ]
500
- == "CREATE SECRET (type 's3', region 'us-east-1', key_id 'my_aws_key', secret 'my_aws_secret');"
502
+ == "CREATE OR REPLACE SECRET (type 's3', region 'us-east-1', key_id 'my_aws_key', secret 'my_aws_secret');"
501
503
)
502
504
503
505
# Verify the SQL for the second secret (Azure)
504
506
assert (
505
507
create_secret_calls [1 ]
506
- == "CREATE SECRET (type 'azure', account_name 'myaccount', account_key 'myaccountkey');"
508
+ == "CREATE OR REPLACE SECRET (type 'azure', account_name 'myaccount', account_key 'myaccountkey');"
507
509
)
508
510
509
511
@@ -541,21 +543,23 @@ def test_duckdb_named_secrets(mock_connect, make_config):
541
543
cursor = config .create_engine_adapter ().cursor
542
544
543
545
execute_calls = [call [0 ][0 ] for call in mock_cursor .execute .call_args_list ]
544
- create_secret_calls = [call for call in execute_calls if call .startswith ("CREATE SECRET" )]
546
+ create_secret_calls = [
547
+ call for call in execute_calls if call .startswith ("CREATE OR REPLACE SECRET" )
548
+ ]
545
549
546
550
# Should have exactly 2 CREATE SECRET calls
547
551
assert len (create_secret_calls ) == 2
548
552
549
553
# Verify the SQL for the first secret (S3) includes the secret name
550
554
assert (
551
555
create_secret_calls [0 ]
552
- == "CREATE SECRET my_s3_secret (type 's3', region 'us-east-1', key_id 'my_aws_key', secret 'my_aws_secret');"
556
+ == "CREATE OR REPLACE SECRET my_s3_secret (type 's3', region 'us-east-1', key_id 'my_aws_key', secret 'my_aws_secret');"
553
557
)
554
558
555
559
# Verify the SQL for the second secret (Azure) includes the secret name
556
560
assert (
557
561
create_secret_calls [1 ]
558
- == "CREATE SECRET my_azure_secret (type 'azure', account_name 'myaccount', account_key 'myaccountkey');"
562
+ == "CREATE OR REPLACE SECRET my_azure_secret (type 'azure', account_name 'myaccount', account_key 'myaccountkey');"
559
563
)
560
564
561
565
0 commit comments