1.26.0 (2024-12-05)
Snowpark Python API Updates
New Features
- Added support for property
version
and class methodget_active_session
forSession
class. - Added new methods and variables to enhance data type handling and JSON serialization/deserialization:
- To
DataType
, its derived classes, andStructField
:type_name
: Returns the type name of the data.simple_string
: Provides a simple string representation of the data.json_value
: Returns the data as a JSON-compatible value.json
: Converts the data to a JSON string.
- To
ArrayType
,MapType
,StructField
,PandasSeriesType
,PandasDataFrameType
andStructType
:from_json
: Enables these types to be created from JSON data.
- To
MapType
:keyType
: keys of the mapvalueType
: values of the map
- To
- Added support for method
appName
inSessionBuilder
. - Added support for
include_nulls
argument inDataFrame.unpivot
. - Added support for following functions in
functions.py
:size
to get size of array, object, or map columns.collect_list
an alias ofarray_agg
.substring
makeslen
argument optional.
- Added parameter
ast_enabled
to session for internal usage (default:False
).
Improvements
- Added support for specifying the following to
DataFrame.create_or_replace_dynamic_table
:iceberg_config
A dictionary that can hold the following iceberg configuration options:external_volume
catalog
base_location
catalog_sync
storage_serialization_policy
- Added support for nested data types to
DataFrame.print_schema
- Added support for
level
parameter toDataFrame.print_schema
- Improved flexibility of
DataFrameReader
andDataFrameWriter
API by adding support for the following:- Added
format
method toDataFrameReader
andDataFrameWriter
to specify file format when loading or unloading results. - Added
load
method toDataFrameReader
to work in conjunction withformat
. - Added
save
method toDataFrameWriter
to work in conjunction withformat
. - Added support to read keyword arguments to
options
method forDataFrameReader
andDataFrameWriter
.
- Added
- Relaxed the cloudpickle dependency for Python 3.11 to simplify build requirements. However, for Python 3.11,
cloudpickle==2.2.1
remains the only supported version.
Bug Fixes
- Removed warnings that dynamic pivot features were in private preview, because
dynamic pivot is now generally available. - Fixed a bug in
session.read.options
whereFalse
Boolean values were incorrectly parsed asTrue
in the generated file format.
Dependency Updates
- Added a runtime dependency on
python-dateutil
.
Snowpark pandas API Updates
New Features
- Added partial support for
Series.map
whenarg
is a pandasSeries
or a
collections.abc.Mapping
. No support for instances ofdict
that implement
__missing__
but are not instances ofcollections.defaultdict
. - Added support for
DataFrame.align
andSeries.align
foraxis=1
andaxis=None
. - Added support for
pd.json_normalize
. - Added support for
GroupBy.pct_change
withaxis=0
,freq=None
, andlimit=None
. - Added support for
DataFrameGroupBy.__iter__
andSeriesGroupBy.__iter__
. - Added support for
np.sqrt
,np.trunc
,np.floor
, numpy trig functions,np.exp
,np.abs
,np.positive
andnp.negative
. - Added partial support for the dataframe interchange protocol method
DataFrame.__dataframe__()
.
Bug Fixes
- Fixed a bug in
df.loc
where setting a single column from a series results in unexpectedNone
values.
Improvements
- Use UNPIVOT INCLUDE NULLS for unpivot operations in pandas instead of sentinel values.
- Improved documentation for pd.read_excel.