snowflake.snowpark.functions.asc_nulls_first¶

snowflake.snowpark.functions.asc_nulls_first(c: Union[Column, str]) → Column[source]¶

Returns a Column expression with values sorted in ascending order (null values sorted before non-null values).

Example:

>>> df = session.create_dataframe([None, 3, 2, 1, None], schema=["a"])
>>> df.sort(asc_nulls_first(df["a"])).collect()
[Row(A=None), Row(A=None), Row(A=1), Row(A=2), Row(A=3)]
Copy