1.59.0 (2026-11-30)
Snowpark Python API Updates
New Features
- Added support for change-tracking reads with the
CHANGESclause.Session.table,DataFrameReader.tableandTableacceptchanges("default"or"append_only") together with the existing time travel arguments, andend_statement,end_offset,end_timestampandend_timestamp_typeto set the end of the changes (ENDclause).DataFrameReaderoptionschanges,end_statement,end_offset,end_timestampandend_timestamp_typeare supported as well. Added the column constantsMETADATA_ACTION,METADATA_ISUPDATEandMETADATA_ROW_IDinsnowflake.snowpark.columnfor the extra columns of such reads. These reads are not supported in local testing, andTable.sampleis not supported on them. - Added the
snowflake.snowpark.mcpmodule (Private Preview) to build tools and servers for the Snowflake-managed MCP server in Python:mcp_toolturns a Python function into a tool, with its argument schema built from the type hints and docstring. A function whose first parameter is aSessionbecomes a stored procedure; any other function becomes a UDF. Results, including DataFrames, are converted to JSON and kept under the MCP server's response limit, andToolErrorreturns an error the model can act on. Deployed tools reject values outside anenumand nulls for arguments that don't allow them, since the MCP server does not validate arguments, and return anINVALID_ARGUMENTSerror. Other errors reach MCP clients as a generic message with an error ID and without the traceback, unlessmask_error_details=False; the full error is logged with the same ID.Tool.from_procedureandTool.from_functionturn existing procedures and UDFs, in any language, into tools.MCPServerprints its specification (to_yaml), deploys it with its Python tools (deploy, which checks the definition first and has adry_runoption, with a suffix for dev and prod copies), calls deployed tools over a session (call_tool), and grants a role everything the tools need (grant_usage).Tool.builtinadds the MCP server's built-in tool types (such as Cortex Agent, Cortex Analyst and Cortex Search) to a server.
- Added
get_external_secret_jsontosnowflake.snowpark.secrets(Private Preview) to read an external secret from AWS, Azure, or GCP. It returns JSON text with the secret value under thevaluekey.
Improvements
- UDFs, UDTFs, UDAFs and stored procedures registered from a free-threaded Python build (for example 3.14t) now default to the matching free-threaded
RUNTIME_VERSION(3.14t) instead of the GIL runtime (3.14). The default artifact repository is looked up for the free-threaded version as well. Requirements that pinpython=3.14(orpython=3.14t) still select that runtime from either build.- The account must support the
3.14truntime; otherwise registration fails with the server's error, like any other unsupported runtime. - Packages must come from an artifact repository such as PyPI. Anaconda packages, including an Anaconda default artifact repository set on the account, database or schema, are not supported on
3.14t. - Packages that are not free-threading safe, such as pandas 2.x, lxml and pyodbc, fail to load, and packages without free-threaded (
cp314t) wheels, such as oracledb, fail to install. As a result,DataFrameReader.xmlwith therowTagoption, thexpathfunctions, andDataFrameReader.dbapiUDTF ingestion for SQL Server and Oracle are not supported from a free-threaded client. DataFrame.to_polarsdoes not work on a free-threaded client, because polars has no free-threaded build.- On a free-threaded client, the
pandasextra installs pandas 2.x, which re-enables the GIL when imported; install pandas 3 instead. Theopentelemetryextra fails to install because grpcio has no free-threaded build; installopentelemetry-api,opentelemetry-sdk,opentelemetry-exporter-otlp-proto-httpandrequestsinstead.
- The account must support the
DataFrameReader.schema()now also accepts a DDL string such as"id INT, name STRING", which is converted to aStructTypewith Snowflake data types and identifier rules, like the names passed toStructField: a double-quoted name is case-sensitive, and an unquoted name is case-insensitive, except that JSON, Parquet and XML reads match it exactly as written.- Type strings now accept the Snowflake type synonyms
TINYINT,CHARandCHARACTER(with an optional length),DEC,REAL,FLOAT4andFLOAT8, andCOMMENT '...'. trace_sql_errors_to_dataframeofSession.debug(Experimental) now maps a SQL compilation error to the single DataFrame operation that caused it when the SQL simplifier merges several operations into one query.trace_sql_errors_to_dataframeofSession.debug(Experimental) now maps SQL compilation errors that have no line number to the DataFrame operations that caused them, using up to 32 extra describe attempts on failure.
Bug Fixes
- Fixed a bug where
DataFrameReader.dbapiwithfetch_with_process=Falsecould hang instead of raising when uploading the fetched data failed while fetch threads were still running. - Fixed a bug where
Table.sampleand seededDataFrame.stat.sample_byignored time travel and Iceberg incremental reads and sampled the current table. For Iceberg incremental reads,seedandSYSTEM/BLOCKsampling are now ignored with a warning. - Fixed a bug where
Table.sampleand seededDataFrame.stat.sample_byon a table embeddedseedinto the SQL without validating it. Aseedthat is not an integer between 0 and 2147483647 now raisesValueError. - Fixed a bug where
DataFrameReader.tablefailed when a time travel reader option was set toNone, e.g.option("time_travel_mode", None)together withoption("as-of-timestamp", ...). Time travel options set toNoneare now treated as unset. - Fixed a bug where
trace_sql_errors_to_dataframeofSession.debug(Experimental) removed empty lines inside string literals of raw SQL, which changed query results. - Fixed a bug in
DataFrameReader.jdbcwhere aquerythat contained string literals, backslashes or newlines failed with a SQL compilation error during schema inference. - Fixed a bug in
DataFrameReader.jdbcwhere reading failed whenDEFAULT_DDL_COLLATIONwas set. - Fixed a bug in
DataFrameReader.jdbcwhere a read with many partitions failed withThis connection has been closed. - Fixed a bug in
DataFrameReader.jdbcwhere JDBC connections were not closed when ingestion failed or a stream was closed before exhaustion.