@@ -489,21 +489,23 @@ def test_duckdb_multiple_secrets(mock_connect, make_config):
489489 cursor = config .create_engine_adapter ().cursor
490490
491491 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+ ]
493495
494496 # Should have exactly 2 CREATE SECRET calls
495497 assert len (create_secret_calls ) == 2
496498
497499 # Verify the SQL for the first secret (S3)
498500 assert (
499501 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');"
501503 )
502504
503505 # Verify the SQL for the second secret (Azure)
504506 assert (
505507 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');"
507509 )
508510
509511
@@ -541,21 +543,23 @@ def test_duckdb_named_secrets(mock_connect, make_config):
541543 cursor = config .create_engine_adapter ().cursor
542544
543545 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+ ]
545549
546550 # Should have exactly 2 CREATE SECRET calls
547551 assert len (create_secret_calls ) == 2
548552
549553 # Verify the SQL for the first secret (S3) includes the secret name
550554 assert (
551555 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');"
553557 )
554558
555559 # Verify the SQL for the second secret (Azure) includes the secret name
556560 assert (
557561 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');"
559563 )
560564
561565
0 commit comments