snowflake.snowpark.functions.least_ignore_nulls¶

snowflake.snowpark.functions.least_ignore_nulls(*columns: Union[snowflake.snowpark.column.Column, str]) → Column[source]¶

Returns the smallest value from a list of expressions, ignoring None values. If all argument values are None, the result is None.

Parameters:

columns (ColumnOrName) – list of column or column names to compare.

Returns:

The smallest value from the list of expressions, ignoring None values.

Return type:

Column

Example:

>>> df = session.create_dataframe([[1, 2, 3], [2, 4, -1], [3, 6, None]], schema=["a", "b", "c"])
>>> df.select(least_ignore_nulls(df["a"], df["b"], df["c"]).alias("least_ignore_nulls")).collect()
[Row(LEAST_IGNORE_NULLS=1), Row(LEAST_IGNORE_NULLS=-1), Row(LEAST_IGNORE_NULLS=3)]
Copy