8000 fix: update test_arrow_cast to cast literals to string type for arrow… · chenkovsky/datafusion-python@856ff8c · GitHub 8000
[go: up one dir, main page]

Skip to content

Commit 856ff8c

Browse files
committed
fix: update test_arrow_cast to cast literals to string type for arrow_cast function
1 parent 3a5e210 commit 856ff8c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

python/tests/test_functions.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
from datafusion import SessionContext, column
2525
from datafusion import functions as f
26-
from datafusion import literal
26+
from datafusion import literal, expr
2727

2828
np.seterr(invalid="ignore")
2929

@@ -907,8 +907,10 @@ def test_temporal_functions(df):
907907

908908
def 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"), 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"),
912914
)
913915
result = df.collect()
914916
assert len(result) == 1

0 commit comments

Comments
 (0)
0