diff --git a/docs/source/user-guide/common-operations/functions.rst b/docs/source/user-guide/common-operations/functions.rst index de446588..add08801 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, utf8_literal + from datafusion import col, literal, string_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"'), utf8_literal("Float64")).alias("total_as_float"), - f.arrow_cast(col('"Total"'), utf8_literal("Int32")).alias("total_as_int") + f.arrow_cast(col('"Total"'), string_literal("Float64")).alias("total_as_float"), + f.arrow_cast(col('"Total"'), str_lit("Int32")).alias("total_as_int") ) Other diff --git a/python/datafusion/__init__.py b/python/datafusion/__init__.py index 42a54c76..04710554 100644 --- a/python/datafusion/__init__.py +++ b/python/datafusion/__init__.py @@ -108,8 +108,10 @@ def literal(value): def string_literal(value): - """Create a UTF8 literal expression. - It differs from `literal` creates a UTF8view literal. + """ + Create a UTF8 literal expression. + + It differs from `literal` which creates a UTF8view literal. """ return Expr.string_literal(value)