Conversation
| return _ArrayExpression(KQL(f'array_slice({_to_kql(array)}, {_to_kql(start)}, {_to_kql(end)})')) | ||
|
|
||
| @staticmethod | ||
| def array_sort_asc(array1: ArrayType, nulls_last: BooleanType = None, *more_arrays: ArrayType) -> _ArrayExpression: |
There was a problem hiding this comment.
the order of the variables is a bit confusing, due to the mismatch between KQL and python.
My suggestion is to use instead:
def array_sort_asc(to_sort: Union[ArrayType, List[ArrayType]], nulls_last: BooleanType = None) -> _ArrayExpression:...
and then handle to_sort according to type.
WDYT?
also @ymost
There was a problem hiding this comment.
Little known Python 3 feature: you can put a keyword argument after a varargs argument, and then it becomes a keyword-only argument.
So we can do this:
def array_sort_asc(*arrays: ArrayType, nulls_last: BooleanType = True) -> _ArrayExpression:
The only down side is that the user will be forced to use keyword notation (e.g. nulls_last=False ).
Also note that per the Kusto default, our default should be 'True'.
No description provided.