snowflake.snowpark.functions.least¶
- snowflake.snowpark.functions.least(*columns: Union[Column, str]) Column [source] (https://github.com/snowflakedb/snowpark-python/blob/v1.26.0/snowpark-python/src/snowflake/snowpark/functions.py#L8454-L8468)¶
Returns the smallest value from a list of expressions. If any of the argument values is NULL, the result is NULL. LEAST supports all data types, including VARIANT.
Example:
>>> df = session.create_dataframe([[1, 2, 3], [2, 4, -1], [3, 6, None]], schema=["a", "b", "c"]) >>> df.select(least(df["a"], df["b"], df["c"]).alias("least")).collect() [Row(LEAST=1), Row(LEAST=-1), Row(LEAST=None)]