You are viewing documentation about an older version (1.1.0). View latest version

snowflake.snowpark.functions.try_cast¶

snowflake.snowpark.functions.try_cast(column: ColumnOrName, to: str | DataType) → Column[source]¶

A special version of CAST for a subset of data type conversions. It performs the same operation (i.e. converts a value of one data type into another data type), but returns a NULL value instead of raising an error when the conversion can not be performed.

The column argument must be a string column in Snowflake.