pub fn resolve_sort_options(
s: &Series,
descending: Option<bool>,
nulls_last: Option<bool>,
) -> PolarsResult<(Option<bool>, Option<bool>)>Expand description
Infers the (descending, nulls_last) sort options for s, honoring any provided hints.
Each returned value is Some when known — taken from the corresponding hint when given,
otherwise inferred from the data — and None when it cannot be inferred from s alone:
descendingisNonewhen there are fewer than two distinct non-null values, so no direction is implied.nulls_lastisNonewhenshas no nulls, is entirely null, or the nulls are interleaved (the last of which is not sorted under any placement and is rejected by theis_sortedcheck).
The two axes are independent, so callers can use whichever was determined even when the other could not be.