From f9814dd4ec18c514a54f89e4ab481ed7dcefed58 Mon Sep 17 00:00:00 2001 From: Siew Kam Onn Date: Tue, 3 Dec 2024 11:16:08 +0800 Subject: [PATCH] docs: update examples to use utf8_literal in arrow_cast function --- docs/source/user-guide/common-operations/functions.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/user-guide/common-operations/functions.rst b/docs/source/user-guide/common-operations/functions.rst index 259435c8..de446588 100644 --- a/docs/source/user-guide/common-operations/functions.rst +++ b/docs/source/user-guide/common-operations/functions.rst @@ -38,7 +38,7 @@ DataFusion offers mathematical functions such as :py:func:`~datafusion.functions .. ipython:: python - from datafusion import col, literal + from datafusion import col, literal, utf8_literal from datafusion import functions as f df.select( @@ -112,8 +112,8 @@ Casting expressions to different data types using :py:func:`~datafusion.function .. ipython:: python df.select( - f.arrow_cast(col('"Total"'), "Float64").alias("total_as_float"), - f.arrow_cast(col('"Total"'), "Int32").alias("total_as_int") + f.arrow_cast(col('"Total"'), utf8_literal("Float64")).alias("total_as_float"), + f.arrow_cast(col('"Total"'), utf8_literal("Int32")).alias("total_as_int") ) Other