github snowflakedb/snowpark-python v1.26.0
Release

13 days ago

1.26.0 (2024-12-05)

Snowpark Python API Updates

New Features

  • Added support for property version and class method get_active_session for Session class.
  • Added new methods and variables to enhance data type handling and JSON serialization/deserialization:
    • To DataType, its derived classes, and StructField:
      • 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 and StructType:
      • from_json: Enables these types to be created from JSON data.
    • To MapType:
      • keyType: keys of the map
      • valueType: values of the map
  • Added support for method appName in SessionBuilder.
  • Added support for include_nulls argument in DataFrame.unpivot.
  • Added support for following functions in functions.py:
    • size to get size of array, object, or map columns.
    • collect_list an alias of array_agg.
    • substring makes len 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 to DataFrame.print_schema
  • Improved flexibility of DataFrameReader and DataFrameWriter API by adding support for the following:
    • Added format method to DataFrameReader and DataFrameWriter to specify file format when loading or unloading results.
    • Added load method to DataFrameReader to work in conjunction with format.
    • Added save method to DataFrameWriter to work in conjunction with format.
    • Added support to read keyword arguments to options method for DataFrameReader and DataFrameWriter.
  • 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 where False Boolean values were incorrectly parsed as True 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 when arg is a pandas Series or a
    collections.abc.Mapping. No support for instances of dict that implement
    __missing__ but are not instances of collections.defaultdict.
  • Added support for DataFrame.align and Series.align for axis=1 and axis=None.
  • Added support for pd.json_normalize.
  • Added support for GroupBy.pct_change with axis=0, freq=None, and limit=None.
  • Added support for DataFrameGroupBy.__iter__ and SeriesGroupBy.__iter__.
  • Added support for np.sqrt, np.trunc, np.floor, numpy trig functions, np.exp, np.abs, np.positive and np.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 unexpected None values.

Improvements

  • Use UNPIVOT INCLUDE NULLS for unpivot operations in pandas instead of sentinel values.
  • Improved documentation for pd.read_excel.

Don't miss a new snowpark-python release

NewReleases is sending notifications on new releases.