File tree 2 files changed +6
-5
lines changed
docs/source/user-guide/common-operations 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ DataFusion offers mathematical functions such as :py:func:`~datafusion.functions
38
38
39
39
.. ipython :: python
40
40
41
- from datafusion import col, literal, utf8_literal
41
+ from datafusion import col, literal, string_literal
42
42
from datafusion import functions as f
43
43
44
44
df.select(
@@ -112,8 +112,8 @@ Casting expressions to different data types using :py:func:`~datafusion.function
112
112
.. ipython :: python
113
113
114
114
df.select(
115
- f.arrow_cast(col(' "Total"' ), utf8_literal (" Float64" )).alias(" total_as_float" ),
116
- f.arrow_cast(col(' "Total"' ), utf8_literal (" Int32" )).alias(" total_as_int" )
115
+ f.arrow_cast(col(' "Total"' ), string_literal (" Float64" )).alias(" total_as_float" ),
116
+ f.arrow_cast(col(' "Total"' ), str_lit (" Int32" )).alias(" total_as_int" )
117
117
)
118
118
119
119
Other
Original file line number Diff line number Diff line change @@ -109,13 +109,14 @@ def literal(value):
109
109
110
110
def string_literal (value ):
111
111
"""Create a UTF8 literal expression.
112
- It differs from `literal` creates a UTF8view literal.
112
+
113
+ It differs from `literal` which creates a UTF8view literal.
113
114
"""
114
115
return Expr .string_literal (value )
115
116
116
117
117
118
def str_lit (value ):
118
- """Alias for `string_literal`"""
119
+ """Alias for `string_literal`. """
119
120
return string_literal (value )
120
121
121
122
You can’t perform that action at this time.
0 commit comments