File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -2637,7 +2637,13 @@ def arrow_typeof(arg: Expr) -> Expr:
26372637def arrow_cast (expr : Expr , data_type : Expr | str | pa .DataType ) -> Expr :
26382638 """Casts an expression to a specified data type.
26392639
2640- The ``data_type`` can be a string, a ``pyarrow.DataType``, or an ``Expr``.
2640+ The ``data_type`` can be a string, a ``pyarrow.DataType``, or an
2641+ ``Expr``. For simple types, :py:meth:`Expr.cast()
2642+ <datafusion.expr.Expr.cast>` is more concise
2643+ (e.g., ``col("a").cast(pa.float64())``). Use ``arrow_cast`` when
2644+ you want to specify the target type as a string using DataFusion's
2645+ type syntax, which can be more readable for complex types like
2646+ ``"Timestamp(Nanosecond, None)"``.
26412647
26422648 Examples:
26432649 >>> ctx = dfn.SessionContext()
You can’t perform that action at this time.
0 commit comments