2025 年 Snowflake Connector for Python 版本说明

本文包含 Snowflake Connector for Python 的版本说明,包括以下内容(如果适用):

  • 行为变更

  • 新功能

  • 面向客户的错误修复

Snowflake 对 Snowflake Connector for Python 更新使用语义版本控制。

有关文档,请参阅 Snowflake Connector for Python

Version 4.0.0 (Oct 9, 2025)

BCR (Behavior Change Release) changes

  • Configuration files writable by a group or others now raise a ConfigSourceError with detailed permission information, preventing potential credential tampering.

  • Reverted changing the exception type in case of token expired scenario for Oauth authenticator back to DatabaseError.

新功能和更新

  • Implemented a new CRL (Certificate Revocation List) checking mechanism.

    Enabling CRLs improves security by checking for revoked certificates during the TLS handshake process. For more information, see the Replacing OCSP with CRL as the method of certificate revocation checking (https://community.snowflake.com/s/article/Replacing-OCSP-with-CRL-as-the-method-of-certificate-revocation-checking) Knowledge Base article.

    This feature is disabled by default. For information on enabling this feature, see CertRevocationCheckMode. We recommend you test this feature in advisory mode before enabling it in production.

  • Added the workload_identity_impersonation_path parameter to support service account impersonation for Workload Identity Federation. Impersonation is available only for Google Cloud and AWS workloads.

  • Added the oauth_credentials_in_body parameter to support sending OAuth client credentials in a connection request body.

  • Added an option to exclude botocore and boto3 dependencies during installation by setting the SNOWFLAKE_NO_BOTO environment variable to true. For the full details, see 安装 Python Connector.

  • Added the ocsp_root_certs_dict_lock_timeout connection parameter to set the timeout (in seconds) for acquiring the lock on the OCSP root certs dictionary. The default value is -1, which represents no timeout.

错误修复

  • Fixed get_results_from_sfqid when using DictCursor and executing multiple statements at once.

  • Fixed retry behavior for ECONNRESET errors.

  • Fixed the return type of SnowflakeConnection.cursor(cursor_class) to match the type of cursor_class.

  • Constrained the types of fetchone, :code:fetchmany, and fetchall.

  • Fixed the "No AWS region was found" error when AWS region was set in the AWS_DEFAULT_REGION variable instead of in AWS_REGION for the WORKLOAD_IDENTITY authenticator.

Version 3.18.0 (Oct 6, 2025)

新功能和更新

  • Added support for pandas conversion for Day-time and Year-Month Interval types.

错误修复

  • 无。

Version 3.17.4 (Sep 22, 2025)

新功能和更新

  • Added support for allowing intermediate certificates from the trust store to act as root certificates.

  • Updated bundled urllib3 to version v2.5.0.

  • Updated bundled requests to version v2.32.5.

  • Dropped support for OpenSSL versions older than 1.1.1.

错误修复

  • 无。

Version 3.17.3 (Sep 3, 2025)

新功能和更新

  • 无。

错误修复

  • Enhanced configuration file permission warning messages.

    • Improved warning messages for readable permission issues to include clear instructions on how to skip warnings using the SF_SKIP_WARNING_FOR_READ_PERMISSIONS_ON_CONFIG_FILE environment variable.

  • Fixed the bug with staging pandas dataframes on AWS --- the regional endpoint is used when required.

    • This fix addresses the issue with the create_dataframe call on Snowpark.

Version 3.17.2 (August 20, 2025)

新功能和更新

  • 无。

错误修复

  • Added the ability to disable endpoint-based platform detection by setting platform_detection_timeout_seconds to zero.

  • Fixed a bug where platform_detection was retrying failed requests with warnings to non-existent endpoints.

Version 3.17.1 (August 14, 2025)

新功能和更新

  • Added the infer_schema parameter to write_pandas to perform schema inference on the passed data.

错误修复

  • Reverted the snowflake namespace back to non-module.

Version 3.17.0 (August 13, 2025)

新功能和更新

  • Added support for workload identity federation in the AWS, Azure, Google Cloud, and Kubernetes platforms.

    • Added the workload_identity_provider connection parameter.

    • Added WORKLOAD_IDENTITY to the values for the authenticator connection parameter.

  • Added an unsafe_skip_file_permissions_check flag to skip file permission checks on the cache and configuration.

  • Added basic JSON support for Interval types.

  • Added populating of type_code in ResultMetadata for interval types.

  • Relaxed the pyarrow version constraint; versions >= 19 can now be used.

  • Introduced the snowflake_version property to the connection.

  • Added support for the use_vectorized_scanner parameter in the write_pandas function.

  • Added support of proxy setup using connection parameters without emitting environment variables.

错误修复

  • Fixed OAuth authenticator values.

  • Fixed a bug where a PAT with an external session authenticator was used while external_session_id was not provided in SnowflakeRestful.fetch.

  • Fixed the case-sensitivity of Oauth and programmatic_access_token authenticator values.

  • Fixed unclear error messages for incorrect authenticator values.

  • Fixed GCS staging by ensuring the endpoint has a scheme.

  • Fixed a bug where time-zoned timestamps fetched as a pandas.DataFrame or pyarrow.Table would overflow due to unnecessary precision. A clear error is now raised if an overflow cannot be prevented.

版本 3.16.0(2025 年 7 月 1 日)

新功能和更新

  • 添加了 client_fetch_use_mp 连接参数,该参数支持对结果批次进行多处理获取,这通常会缩短提取时间。

  • 添加了对带外部会话 ID 的新个人访问令牌 (PAT) 身份验证机制的支持。

  • write_pandas 函数中添加了 bulk_upload_chunks 参数。如果将此参数设置为 True,则会更改 write_pandas 函数的行为,即先将所有数据块写入到本地磁盘,然后将数据块文件夹以通配符的形式上传至暂存区。当设置为 :codenowrap:`False`(默认)时,数据块将逐一保存、上传和删除。

  • 添加了对 Python 3.13 的 Windows 支持。

  • 添加了对 Interval 类型的支持。

  • 为本地应用程序添加了对 Snowflake OAuth 的支持。

错误修复

  • 修复了位置名称中 write_pandas 特殊字符使用的问题。

  • 修复了为 Google Cloud Storage (GCS) 客户端构建位置时使用 use_virtual_url 的问题。

版本 3.15.0(2025 年 4 月 28 日)

非公开预览版 (PrPr) 功能

Added support for workload identity federation in the AWS, Azure, GCP and Kubernetes platforms.

免责声明:

  • 只有将 SF_ENABLE_EXPERIMENTAL_AUTHENTICATION 环境变量设置为 true 时,才能使用此功能。

  • 应仅在非生产数据中使用此功能。

  • 此 PrPr 功能不在支持范围内。但在 PrPr 阶段,产品和工程团队可提供服务。

  • 如需了解参与情况和相关文档,请联系您的客户团队。

新功能和更新

  • 添加了对 OAuth 2.0 授权代码流、OAuth 2.0 客户端凭据流和 OAuth 令牌缓存的全新身份验证方法支持。

    • 对于 OAuth 2.0 授权代码流:

      • 添加了 oauth_client_idoauth_client_secretoauth_authorization_urloauth_token_request_urloauth_redirect_urioauth_scopeoauth_disable_pkceoauth_enable_refresh_tokensoauth_enable_single_use_refresh_tokens 参数。

      • 为参数身份验证器添加了 OAUTH_AUTHORIZATION_CODE 值。

    • 对于 OAuth 2.0 客户端凭据流:

      • 添加了 oauth_client_idoauth_client_secretoauth_token_request_urloauth_scope 参数。

      • 为参数身份验证器添加了 OAUTH_CLIENT_CREDENTIALS 值。

    • 对于 OAuth 令牌缓存:需要将用户名传递给驱动程序配置,并且 client_store_temporary_credential property 属性不能设置为 true

错误修复

  • 将所需的最低 botobotocore 版本设为 1.24。

  • 修复了 OSCP 在已获得可信证书的情况下终止证书链遍历的问题。

版本 3.14.1(2025 年 4 月 21 日)

非公开预览版 (PrPr) 功能

  • 添加了 client_fetch_threads 实验参数,以更好地利用线程来提取查询结果。

  • 添加了新的实验性身份验证方法:

    • OAuth 授权码和客户端凭据流。

    • 适用于 AWS、Azure、GCP 和 Kubernetes 平台的工作负载身份联合。

免责声明:

  • 这些功能只能通过将 SF_ENABLE_EXPERIMENTAL_AUTHENTICATION 环境变量设置为 true 来访问。

  • 这些功能仅应在非生产数据中使用。

  • 这些 PrPr 功能不在支持服务的覆盖范围内。但在 PrPr 阶段,产品和工程团队可提供服务。

  • 如需了解参与情况和相关文档,请联系您的客户团队。

新功能和更新

  • 添加了对 Python 3.13 的支持。

    备注

    Windows 64 支持仍处于试验阶段,不应用于生产环境。

  • 移除了对 Python 3.8 的支持。

  • 添加了对基本十进制 floating-point 类型的支持。

  • 添加了在 password 字段中提供 PAT 的支持。

  • 添加了对 GCS 区域端点的支持。

  • 添加了对 GCS 虚拟 URLs 的支持。有关更多信息,请参阅 请求端点 (https://cloud.google.com/storage/docs/request-endpoints#xml-api)。

  • 添加了相关支持,允许连接器继承在上游生成的 UUID4,它在语句参数(字段:requestId)中提供,而非自动生成 UUID4 用于 HTTP 请求 ID。

  • 改进了 urllib3、boto3 和 botocore 库中的日志记录,以确保即使将来迁移到外部自有库之后,仍能进行数据掩码。

  • 将某些消息的日志级别从 info 降低到了 debug,确保输出更易于理解。

  • 提高了临时凭据缓存存储的安全性和稳健性。

  • 启用了 insecure_mode 连接属性,并替换为 disable_ocsp_checks,行为与先前的属性相同。

  • Implemented and improved the file-based credentials cache for Linux, including enhanced token caching.

错误修复

  • 改进了因超时而取消客户端查询的错误消息。

  • 修复了一个错误,该错误导致驱动程序在 TO_DATE 行转换为 python 时,遇到无效日期之后是正确的日期时发生静默失败。

  • 添加了 check_arrow_conversion_error_on_every_column 连接属性,可设置为 False 以恢复先前行为,即驱动程序忽略错误,直至错误出现在最后一列。此选项可让您解锁可能受错误修复影响的工作流程,这些工作流程将在后续版本中移除。

  • 修复了过期的 S3 凭据更新和发现过期凭据时进行递增重试的问题。

版本 3.14.0(2025 年 3 月 3 日)

新功能和更新

  • 将 pyOpenSSL 依赖项上边界从 <25.0.0 升级到 <26.0.0。

  • 优化了分发包查找,以提高导入速度。

  • write_pandas 增加了对 Iceberg 表的支持。

  • 增加了对 File 类型的支持。

错误修复

  • pyarrow 添加了 <19.0.0 pin,作为影响 Azure Batch 的一个错误的一种解决方法。

  • 修复了以大写形式指定 privatelink 账户名称时,无法确定 privatelink OCSP 缓存 URL 的错误。

  • 修复了 base64 编码的私钥测试。

  • 修复了 Windows 上文件权限检查的一个错误。

  • 添加了 unsafe_file_write 连接参数,用于恢复先前使用带有 644 权限的 GET 下载的文件的保存行为。

版本 3.13.2(2025 年 1 月 30 日)

新功能和更新

  • 连接器不再使用限定范围的临时对象。

错误修复

  • 无。

版本 3.13.1(2025 年 1 月 29 日)

新功能和更新

  • 无。

错误修复

  • 针对 SQL 注入强化了 snowflake.connector.pandas_tools 模块。有关更多信息,请参阅 CVE-2025-24793 (https://github.com/snowflakedb/snowflake-connector-python/security/advisories/GHSA-2vpq-fh52-j3wv)。

  • 本地 OCSP 缓存已更新,以使用 json 模块而不是 pickle 来序列化其内容。有关更多信息,请参阅 CVE-2025-24794 (https://github.com/snowflakedb/snowflake-connector-python/security/advisories/GHSA-m4f6-vcj4-w5mx)。

  • Linux 凭据缓存文件权限已明确更新为仅对所有者可读。有关更多信息,请参阅 CVE-2025-24795 (https://github.com/snowflakedb/snowflake-connector-python/security/advisories/GHSA-r2x6-cjg7-8r43)。

  • 更新了使用 GET 下载的文件的文件权限,仅允许文件所有者读取。

版本 3.13.0(2025 年 1 月 23 日)

新功能和更新

  • 添加了 iobound_tpe_limit 连接参数,以限制 PUT 和 GET 命令期间 IO-bound ThreadPoolExecutors 的大小。默认情况下,大小按文件数和 CPU 核心数中的较小值计算。

  • 添加了 Connection.is_valid() 方法,用于验证连接是否足够稳定,可以接收查询。

  • 将光标块 rowcount 的日志级别从 INFO 更新到 DEBUG。

  • private_key 身份验证类型中增加了对 base64 编码的 DER 私钥字符串的支持。

  • 已更新 README.md,以包括有关如何使用 cosign 验证包签名的说明。

错误修复

  • 无。

语言: 中文