From 74cbd3b92aec9ab79d6a6df48c5af7b91e6d0470 Mon Sep 17 00:00:00 2001 From: Siew Kam Onn Date: Tue, 3 Dec 2024 10:41:06 +0800 Subject: [PATCH] docs: add clarification comments for utf8_literal usage in arrow_cast tests --- python/tests/test_functions.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/tests/test_functions.py b/python/tests/test_functions.py index 39518a49..68e28811 100644 --- a/python/tests/test_functions.py +++ b/python/tests/test_functions.py @@ -911,6 +911,9 @@ def test_temporal_functions(df): def test_arrow_cast(df): df = df.select( + # we use `utf8_literal` to returns utf8 instead of `literal` which returns utf8view + # because datafusion.arrow_cast # expects a utf8 instead of utf8view + # https://github.com/apache/datafusion/blob/86740bfd3d9831d6b7c1d0e1bf4a21d91598a0ac/datafusion/functions/src/core/arrow_cast.rs#L179 f.arrow_cast(column("b"), utf8_literal("Float64")).alias("b_as_float"), f.arrow_cast(column("b"), utf8_literal("Int32")).alias("b_as_int"), )