Salesforce

Snowflake Connector for Python Release Notes

« Go Back

Information

 
Summary
Last Modified DateOctober 3, 2023
Article Body

This article contains the release notes for the Snowflake Connector for Python. It includes the following information:

  • Behavior changes
  • New features
  • Customer-facing bug fixes


Note: As of September 2023,  Snowflake Connector for Python release notes  are published on the Snowflake documentation site and will no longer appear on this page. Please update any links you might have saved.
 

Version 3.1.0 (August 28, 2023)

New Features and Updates

  • Added support for RSAPublicKey when constructing AuthByKeyPair in addition to raw bytes.

Bug Fixes

  • Fixed a bug in retry logic for okta authentication to refresh token.
  • Fixed a bug when connecting through SOCKS5 proxy, the attribute proxy_header is missing on SOCKSProxyManager.
 

Version 3.1.0 (July 31, 2023)

New Features and Updates

  • Added a feature that lets you add connection definitions to the connections.toml configuration file. A connection definition refers to a collection of connection parameters, for example, if you wanted to define a connection named "prod":
[prod]
account = "my_account"
user = "my_user"
password = "my_password"
 

By default, we look for the connections.toml file in the location specified in the SNOWFLAKE_HOME environment variable (default: ~/.snowflake). If this folder does not exist, the Python connector looks for the file in the platformdirs location, as follows:
  • On Linux: ~/.config/snowflake/,  but follows XDG settings
  • On Mac: ~/Library/Application Support/snowflake/
  • On Windows: %USERPROFILE%\\AppData\\Local\\snowflake\\
You can determine which file is used by running the following command:
python -c "from snowflake.connector.constants import CONNECTIONS_FILE; print(str(CONNECTIONS_FILE))"
  • Bumped cryptography dependency from <41.0.0,>=3.1.0 to >=3.1.0,<42.0.0.
  • Improved OCSP response caching to remove tmp cache files on Windows
  • Improved OCSP response caching to reduce the times of disk writing.
  • Added a parameter server_session_keep_alive in SnowflakeConnection that skips session deletion when client connection closes.
  • Tightened our pinning of platformdirs, to prevent their new releases breaking new versions of the connector.
  • Allowed you to pass type_mapper to fetch_pandas_batches() and fetch_pandas_all().
  • Improved retry logic for okta authentication to refresh token if authentication gets throttled.
  • Added retry reasons for queries that are retried by the client.
  • Remove Python 3.7 support.
  • Improved error handling of connection reset error.

Bug Fixes

  • Fixed a bug where SFPlatformDirs would incorrectly append application_name/version to its path.
  • Fixed a bug where write_pandas fails when user does not have the privilege to create stage or file format in the target schema, but has the right privilege for the current schema.
  • Worked around a segfault which sometimes occurred during cache serialization in multi-threaded scenarios.
  • Fixed a bug about deleting the temporary files happened when running PUT command.
  • Fixed a bug where pickle.dump segfaults during cache serialization in multi-threaded scenarios.
 

Version 3.0.4 (May 25, 2023)

New Features

  • Added the json_result_force_utf8_decoding connection parameter to force decoding JSON content in utf-8 when the result format is JSON.
  • Bumped vendored library urllib3 to 1.26.15
  • Bumped vendored library requests to 2.29.0
  • Bumped pandas dependency from <1.6.0,>=1.0.0 to >=1.0.0,<2.1.0
  • Add support for Geometry types.

Bug Fixes

  • Fixed a bug in which cursor.execute() could modify the argument statement_params dictionary object when executing a multistatement query.
  • Fixed a bug prevented calling SnowflakeCursor.nextset before fetching the result of the first query if the cursor runs an async multistatement query.
  • Fixed a bug when _prefetch_hook() was not called before yielding results of execute_async().
  • Fixed a bug where some ResultMetadata fields were marked as required when they were optional.
  • Fixed a bug where bulk insert converts date incorrectly.

Version 3.0.3 (April 20, 2023)

New Features

  • Added a parameter that allows users to skip file uploads to stage if file exists on stage and contents of the file match.
  • Improved type hint of `SnowflakeCursor.execute` method.
  • Improved GET logging to warn when downloading multiple files with the same name.

Bug Fixes

  • Fixed a bug that prints error in logs for GET command on GCS.
  • Added a parameter that allows users to skip file uploads to stage if file exists on stage and contents of the file match.
  • Fixed a bug that occurred when writing a Pandas DataFrame with column names containing double quotes in snowflake.connector.pandas_tool.write_pandas.
  • Fixed a bug that occurred when writing a Pandas DataFrame with binary data in snowflake.connector.pandas_tool.write_pandas.
 

Version 3.0.2 (March 23, 2023)

New Features

  • None.

Bug Fixes

  • Fixed a bug of incorrect type hints of SnowflakeCursor.fetch_arrow_all and SnowflakeCursor.fetchall.
  • Improved logging to mask tokens in case of errors.
  • Fixed a bug where snowflake.connector.util_text.split_statements swallowed the final line break in the case when there are no space between lines.
  • Fixed a memory leak in the logging module of the Cython extension.
  • Fixed a bug where the put command on AWS raised an AttributeError when uploading a file composed of multiple parts.
  • Fixed a bug where the put command on AWS raised an AttributeError for file sizes larger than 200MB.
 

Version 3.0.1 (March 01, 2023)

New Features

  • Improved the robustness of OCSP response caching to handle errors in cases of serialization and deserialization.
  • Replaced the dependency on setuptools in favor of packaging.
  • Updated async_executes method's doc-string.
  • Errors raised now have a query field that contains the SQL query that caused them when available.

Bug Fixes

  • Fixed a bug where AuthByKeyPair.handle_timeout should pass keyword arguments instead of positional arguments when calling AuthByKeyPair.prepare.
  • Fixed a bug where MFA token caching would refuse to work until restarted instead of reauthenticating.

 

Version 3.0.0 (January 27, 2023)

BCR (Behavior Change Release) Change

  • Fixed a bug where write_pandas did not use user-specified schemas and databases to create intermediate objects.
Previously, the write_pandas function created temporary objects in the currently-used database and schema and only put the final table (that was created or appended) in the user-specified database and schema. With this version, if the database or schema parameters for write_pandas are different than the currently-selected one, you need to make sure that the user who is executing write_pandas has access to create/drop temporary stages, file formats, and tables with the schema referenced by the write_pandas function.
 
Snowflake recommends that you test any new driver version in pre-production environments before deploying to production environments.  With this behavior change, you should give special attention to the scenario(s) listed above (i.e. write_pandas with database or schemas parameters that differ from the current context).

New Features and Updates

  • Bumped pyarrow dependency from >=8.0.0,<8.1.0 to >=10.0.1,<10.1.0
  • Bumped pyOpenSSL dependency from <23.0.0 to <24.0.0
  • During browser-based authentication, the SSO url is now printed before opening it in the browser
  • Increased the level of a log for when ArrowResult cannot be imported
  • Added a minimum MacOS version check when compiling C-extensions

Bug Fixes

  • Fixed a bug where write_pandas did not use user-specified schema and database to create intermediate objects
  • Fixed a bug where HTTP response code of 429 were not retried
  • Fixed a bug where MFA token caching was not working

Version 2.9.0 (December 14, 2022)

New Features

  • Reworked authentication internals to allow users to plug custom key-pair authenticators.
  • Multi-statement query execution is now supported through cursor.execute and cursor.executemany.
    • The Snowflake parameter MULTI_STATEMENT_COUNT can be altered at the account, session, or statement level. An additional argument, num_statements, can be provided to execute to use this parameter at the statement level. It must be provided to executemany to submit a multi-statement query through the method. Note that bulk insert optimizations available through executemany are not available when submitting multi-statement queries.
      • By default the parameter is 1, meaning only a single query can be submitted at a time.
      • Set to 0 to submit any number of statements in a multi-statement query.
      • Set to >1 to submit the specified exact number of statements in a multi-statement query.
      • Bindings are accepted in the same way for multi-statements as they are for single statement queries.
    • Asynchronous multi-statement query execution is supported. Users should still use get_results_from_sfqid to retrieve results.
    • To access the results of each query, users can call SnowflakeCursor.nextset() as specified in the DB 2.0 API (PEP-249), to iterate through each statements results.
      • The first statement's results are accessible immediately after calling execute (or get_results_from_sfqid if asynchronous) through the existing fetch*() methods.

Bug Fixes

  • Fixed a bug where the permission of the file downloaded via GET command is changed.

Version 2.8.3 (November 28, 2022)

New Features

  • Bumped cryptography dependency from <39.0.0 to <41.0.0.

Bug Fixes

  • Fixed a bug where an expired OCSP response cache caused infinite recursion during cache loading.

Version 2.8.2 (November 18, 2022)

New Features

  • Improved performance of OCSP response caching.
  • No longer resolve target location on the local machine during the execution of GET commands.
  • Improved performance of regexes used for PUT/GET SQL statement detection.

Version 2.8.1 (October 28, 2022)

New Features

  • Bumped cryptography dependency from <37.0.0 to <39.0.0.
  • When closing a connection, the async query status checking is now parallelized.

Bug Fixes

  • Fixed an issue where write_pandas wouldn't write an empty DataFrame to Snowflake.

Version 2.8.0 (September 27, 2022)

Bug Fixes

  • Fixed missing dtypes when calling fetch_pandas() and fetch_arrow() on empty results.
  • Fixed a bug where rowcount was deleted when the cursor was closed.
  • Fixed a bug where extTypeName was used even when it was empty.
  • Updated how telemetry entries are constructed.
  • Added telemetry for imported root packages during run-time.
  • Added telemetry for using write_pandas.
  • The write_pandas function now supports providing additional arguments to be used by DataFrame.to_parquet.
  • All optional parameters of write_pandas can now be provided to pd_writer and make_pd_writer to be used with DataFrame.to_sql.

Version 2.7.12 (August 24, 2022)

New Features

  • Added in-file caching for OCSP response caching.
  • Added support for OKTA Identity Engine.
  • The write_pandas function now supports transient tables through the new table_type argument that supersedes create_temp_table argument.

Bug Fixes

  • Fixed a bug where timestamps fetched as pandas.DataFrame or pyarrow.Table would overflow for the sake of unnecessary precision. In the case where an overflow cannot be prevented, a clear error is now raised.
  • Fixed a bug where calling fetch_pandas_batches incorrectly raised NotSupportedError after an async query was executed.

Version 2.7.11 (July 28, 2022)

Bug Fixes

  • Added a minimum version pin to typing_extensions.

Version 2.7.10 (July 25, 2022)

New Features

  • Added an in-memory cache to OCSP requests.
  • Added an overwrite option to write_pandas.
  • Added the lastrowid attribute to SnowflakeCursor in compliance with PEP-249.
  • Added new connection diagnostics capabilities.
  • Updated the following libraries and resources:
    • Supported pyarrow versions to 8.0.X.
    • Vendored library versions requests to 2.28.1 and urllib3 to 1.26.10.
    • Supported numby dependency versions from 1.23.0 to 1.24.0.

Bug Fixes

  • Fixed an issue where gzip-compressed HTTP requests might be garbled by an unflushed buffer.

Version 2.7.5 (March 18, 2022)

Behavior Change

  • Deprecated support for Python 3.6.

New Feature

  • Added an option for partners to inject their name through an environmental variable (SF_PARTNER).

Bug Fixes

  • Fixed a bug where we would not wait for input if a browser window couldn't be opened for SSO login.
  • Exported a type definition for SnowflakeConnection.
  • Fixed a bug where final Arrow table would contain duplicate index numbers when using fetch_pandas_all.

Version 2.7.3 (January 18, 2022)

Bug Fixes

  • Moved package metadata from setup.py to setup.cfg.
  • Added Timezone to Timestamp_TZ.
  • Fixed an error related to storage credentials.
  • Fixed an issue where py.typed was not being included in wheels.
  • Fix an issue where negative numbers were not correctly converted using arrow_number_to_decimal.
  • Addeed file handling for empty files when using GET.
  • Fixed the long description rendering for PyPi.
  • Added error handling for DUO when SMS is not present.
  • Added the ability to auto-create a table when writing a pandas DataFrame to a Snowflake table.
  • Updated numpy requirement from <1.22.0 to <1.23.0.
  • Updated the CODEOWNERS file.
TitleSnowflake Connector for Python Release Notes
URL NameSnowflake-Connector-for-Python-Release-Notes
CategoryProduct Release
Sub Category 
Article Record TypeRelease Notes

Powered by