From 91d968cc2d613b6efcab8ac9f9baf420338e2a8f Mon Sep 17 00:00:00 2001 From: Adam Ling Date: Mon, 22 Jul 2024 12:03:29 -0700 Subject: [PATCH] SNOW-1526475: fix type hint for private_key (#1996) --- DESCRIPTION.md | 1 + src/snowflake/connector/connection.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION.md b/DESCRIPTION.md index d729151e6..040389065 100644 --- a/DESCRIPTION.md +++ b/DESCRIPTION.md @@ -12,6 +12,7 @@ Source code is also available at: https://github.com/snowflakedb/snowflake-conne - Set default connection timeout of 10 seconds and socket read timeout of 10 minutes for HTTP calls in file transfer. - Optimized `to_pandas()` performance by fully parallel downloading logic. - Fixed a bug that specifying client_session_keep_alive_heartbeat_frequency in snowflake-sqlalchemy could crash the connector. + - Fixed incorrect type hint of connection parameter `private_key`. - Added support for connectivity to multiple domains. - Bumped keyring dependency from g>=23.1.0,<25.0.0 to g>=23.1.0,<26.0.0 diff --git a/src/snowflake/connector/connection.py b/src/snowflake/connector/connection.py index 9eabf65ae..4bedc3039 100644 --- a/src/snowflake/connector/connection.py +++ b/src/snowflake/connector/connection.py @@ -183,7 +183,7 @@ def _get_private_bytes_from_file( "backoff_policy": (DEFAULT_BACKOFF_POLICY, Callable), "passcode_in_password": (False, bool), # Snowflake MFA "passcode": (None, (type(None), str)), # Snowflake MFA - "private_key": (None, (type(None), str, RSAPrivateKey)), + "private_key": (None, (type(None), bytes, RSAPrivateKey)), "private_key_file": (None, (type(None), str)), "private_key_file_pwd": (None, (type(None), str, bytes)), "token": (None, (type(None), str)), # OAuth or JWT Token