File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -1100,9 +1100,9 @@ def arrow_typeof(arg: Expr) -> Expr:
1100
1100
return Expr (f .arrow_typeof (arg .expr ))
1101
1101
1102
1102
1103
- def arrow_cast (expr : Expr , data_type : Expr ) -> Expr :
1103
+ def arrow_cast (expr : Expr , data_type : str ) -> Expr :
1104
1104
"""Casts an expression to a specified data type."""
1105
- return Expr (f .arrow_cast (expr .expr , data_type . expr ))
1105
+ return Expr (f .arrow_cast (expr .expr , data_type ))
1106
1106
1107
1107
1108
1108
def random () -> Expr :
Original file line number Diff line number Diff line change @@ -907,10 +907,8 @@ def test_temporal_functions(df):
907
907
908
908
def test_arrow_cast (df ):
909
909
df = df .select (
910
- f .arrow_cast (column ("a" ), literal ("Float64" ).cast (pa .string ())).alias (
911
- "a_as_float"
912
- ),
913
- f .arrow_cast (column ("a" ), literal ("Int32" ).cast (pa .string ())).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" ),
914
912
)
915
913
result = df .collect ()
916
914
assert len (result ) == 1
You can’t perform that action at this time.
0 commit comments