File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 1717"""User functions for operating on :py:class:`~datafusion.expr.Expr`."""
1818
1919from __future__ import annotations
20-
2120from datafusion ._internal import functions as f
2221from datafusion .expr import (
2322 CaseBuilder ,
@@ -1100,9 +1099,9 @@ def arrow_typeof(arg: Expr) -> Expr:
11001099 return Expr (f .arrow_typeof (arg .expr ))
11011100
11021101
1103- def arrow_cast (expr : Expr , data_type : Expr ) -> Expr :
1102+ def arrow_cast (expr : Expr , data_type : str ) -> Expr :
11041103 """Casts an expression to a specified data type."""
1105- return Expr (f .arrow_cast (expr .expr , data_type .expr ))
1104+ return Expr (f .arrow_cast (expr .expr , literal ( data_type ) .expr ))
11061105
11071106
11081107def random () -> Expr :
Original file line number Diff line number Diff line change @@ -907,8 +907,8 @@ def test_temporal_functions(df):
907907
908908def test_arrow_cast (df ):
909909 df = df .select (
910- f .arrow_cast (column ("a" ), literal ( "Float64" ) ).alias ("a_as_float" ),
911- f .arrow_cast (column ("a" ), literal ( "Int32" ) ).alias ("a_as_int" ),
910+ f .arrow_cast (column ("a" ), "Float64" ).alias ("a_as_float" ),
911+ f .arrow_cast (column ("a" ), "Int32" ).alias ("a_as_int" ),
912912 )
913913 result = df .collect ()
914914 assert len (result ) == 1
You can’t perform that action at this time.
0 commit comments