Skip to content

Commit dd050d3

Browse files
committed
feat: update array_to_string function to use pa.string() for delimiter casting
1 parent 1f60d58 commit dd050d3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

python/datafusion/functions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
expr_list_to_raw_expr_list,
3131
sort_list_to_raw_sort_list,
3232
)
33+
from datafusion.types import DataType
3334

3435
if TYPE_CHECKING:
3536
from datafusion.context import SessionContext
@@ -317,7 +318,7 @@ def decode(expr: Expr, encoding: Expr) -> Expr:
317318

318319
def array_to_string(expr: Expr, delimiter: Expr) -> Expr:
319320
"""Converts each element to its text representation."""
320-
return Expr(f.array_to_string(expr.expr, delimiter.cast(str).expr))
321+
return Expr(f.array_to_string(expr.expr, delimiter.cast(pa.string()).expr))
321322

322323

323324
def array_join(expr: Expr, delimiter: Expr) -> Expr:

0 commit comments

Comments
 (0)