Skip to content

Commit 74cbd3b

Browse files
committed
docs: add clarification comments for utf8_literal usage in arrow_cast tests
1 parent 0106cb7 commit 74cbd3b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

python/tests/test_functions.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,9 @@ def test_temporal_functions(df):
911911

912912
def test_arrow_cast(df):
913913
df = df.select(
914+
# we use `utf8_literal` to returns utf8 instead of `literal` which returns utf8view
915+
# because datafusion.arrow_cast # expects a utf8 instead of utf8view
916+
# https://github.com/apache/datafusion/blob/86740bfd3d9831d6b7c1d0e1bf4a21d91598a0ac/datafusion/functions/src/core/arrow_cast.rs#L179
914917
f.arrow_cast(column("b"), utf8_literal("Float64")).alias("b_as_float"),
915918
f.arrow_cast(column("b"), utf8_literal("Int32")).alias("b_as_int"),
916919
)

0 commit comments

Comments
 (0)