0.7.0
New Features:
- Added support for user-defined table functions (UDTFs).
- Use function
snowflake.snowpark.functions.udtf()
to register a UDTF, or use it as a decorator to register the UDTF.- You can also use
Session.udtf.register()
to register a UDTF.
- You can also use
- Use
Session.udtf.register_from_file()
to register a UDTF from a Python file.
- Use function
- Updated APIs to query a table function, including both Snowflake built-in table functions and UDTFs.
- Use function
snowflake.snowpark.functions.table_function()
to create a callable representing a table function and use it to call the table function in a query. - Alternatively, use function
snowflake.snowpark.functions.call_table_function()
to call a table function. - Added support for
over
clause that specifiespartition by
andorder by
when lateral joining a table function. - Updated
Session.table_function()
andDataFrame.join_table_function()
to acceptTableFunctionCall
instances.
- Use function
Breaking Changes:
- When creating a function with
functions.udf()
andfunctions.sproc()
, you can now specify an empty list for theimports
orpackages
argument to indicate that no import or package is used for this UDF or stored procedure. Previously, specifying an empty list meant that the function would use session-level imports or packages. - Improved the
__repr__
implementation of data types intypes.py
. The unusedtype_name
property has been removed. - Added a Snowpark-specific exception class for SQL errors. This replaces the previous
ProgrammingError
from the Python connector.
Improvements:
- Added a lock to a UDF or UDTF when it is called for the first time per thread.
- Improved the error message for pickling errors that occurred during UDF creation.
- Included the query ID when logging the failed query.
Bug Fixes:
- Fixed a bug in which non-integral data (such as timestamps) was occasionally converted to integer when calling
DataFrame.to_pandas()
. - Fixed a bug in which
DataFrameReader.parquet()
failed to read a parquet file when its column contained spaces. - Fixed a bug in which
DataFrame.copy_into_table()
failed when the dataframe is created by reading a file with inferred schemas.
Deprecations
Session.flatten()
and DataFrame.flatten()
.
Dependency Updates:
- Restricted the version of
cloudpickle
<=2.0.0
.