Skip to content

Commit 28e677d

Browse files
committed
Amend list_repeat code example - literal
1 parent 7a6bcd4 commit 28e677d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/source/user-guide/common-operations/expressions.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,12 @@ This function returns a new array with the elements repeated.
129129

130130
.. ipython:: python
131131
132-
from datafusion import SessionContext, col
132+
from datafusion import SessionContext, col, literal
133133
from datafusion.functions import list_repeat
134134
135135
ctx = SessionContext()
136136
df = ctx.from_pydict({"a": [[1, 2, 3]]})
137-
df.select(list_repeat(col("a"), 2).alias("repeated_array"))
137+
df.select(list_repeat(col("a"), literal(2)).alias("repeated_array"))
138138
139139
In this example, the `repeated_array` column will contain `[[1, 2, 3], [1, 2, 3]]`.
140140

0 commit comments

Comments
 (0)