File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed
docs/source/user-guide/common-operations Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ approaches.
8282 Indexing an element of an array via ``[] `` starts at index 0 whereas
8383 :py:func: `~datafusion.functions.array_element ` starts at index 1.
8484
85- To check if an array is empty, you can use the function :py:func: `datafusion.functions.array_empty `.
85+ To check if an array is empty, you can use the function :py:func: `datafusion.functions.array_empty ` or ` datafusion.functions.empty ` .
8686This function returns a boolean indicating whether the array is empty.
8787
8888.. ipython :: python
Original file line number Diff line number Diff line change 125125 "decode" ,
126126 "degrees" ,
127127 "digest" ,
128+ "empty" ,
128129 "encode" ,
129130 "ends_with" ,
130131 "exp" ,
@@ -1522,6 +1523,13 @@ def cardinality(array: Expr) -> Expr:
15221523 return Expr (f .cardinality (array .expr ))
15231524
15241525
1526+ def empty (array : Expr ) -> Expr :
1527+ """
1528+ This is an alias for :py:func:`array_empty`.
1529+ """
1530+ return array_empty (array )
1531+
1532+
15251533# aggregate functions
15261534def approx_distinct (
15271535 expression : Expr ,
Original file line number Diff line number Diff line change @@ -313,6 +313,10 @@ def py_flatten(arr):
313313 lambda col : f .array_empty (col ),
314314 lambda data : [len (r ) == 0 for r in data ],
315315 ],
316+ [
317+ lambda col : f .empty (col ),
318+ lambda data : [len (r ) == 0 for r in data ],
319+ ],
316320 [
317321 lambda col : f .array_extract (col , literal (1 )),
318322 lambda data : [r [0 ] for r in data ],
You can’t perform that action at this time.
0 commit comments