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

Commit 8c5e98c

Browse files
authored
Merge pull request #34 from datafold/data_diff_issue_442
snowflake: add support for key password
2 parents 6c53273 + c4b4b68 commit 8c5e98c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sqeleton/databases/snowflake.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,13 @@ def __init__(self, *, schema: str, **kw):
167167
with open(kw.get("key"), "rb") as key:
168168
if "password" in kw:
169169
raise ConnectError("Cannot use password and key at the same time")
170+
if kw.get("private_key_passphrase"):
171+
encoded_passphrase = kw.get("private_key_passphrase").encode()
172+
else:
173+
encoded_passphrase = None
170174
p_key = serialization.load_pem_private_key(
171175
key.read(),
172-
password=None,
176+
password=encoded_passphrase,
173177
backend=default_backend(),
174178
)
175179

0 commit comments

Comments
 (0)