Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit d12b8b6

Browse files
committed
Fix password error message for PR
1 parent fc5b6cf commit d12b8b6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

data_diff/databases/snowflake.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import logging
22

33
from .database_types import *
4-
from .base import Database, import_helper, _query_conn, CHECKSUM_MASK
4+
from .base import ConnectError, Database, import_helper, _query_conn, CHECKSUM_MASK
55

66

77
@import_helper("snowflake")
@@ -41,9 +41,11 @@ def __init__(self, *, schema: str, **kw):
4141
"key" in kw
4242
): # if private keys are used for Snowflake connection, read in key from path specified and pass as "private_key" to connector.
4343
with open(kw.get("key"), "rb") as key:
44+
if 'password' in kw:
45+
raise ConnectError("Cannot use password and key at the same time")
4446
p_key = serialization.load_pem_private_key(
4547
key.read(),
46-
password=kw.pop("password", None),
48+
password=None,
4749
backend=default_backend(),
4850
)
4951

0 commit comments

Comments
 (0)