Skip to content

Commit 164decd

Browse files
committed
fix: update examples in user guide to use f.to_timestamp for date extraction
1 parent 5cc0442 commit 164decd

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,11 @@ Extracting parts of a date using :py:func:`~datafusion.functions.date_part` (ali
8282

8383
.. ipython:: python
8484
85-
df.select(
86-
f.date_part(literal("month"), col('"event_time"')).alias("month"),
87-
f.extract(literal("day"), col('"event_time"')).alias("day")
88-
)
85+
df.select(
86+
f.date_part(literal("month"), f.to_timestamp(col('"Total"'))).alias("month"),
87+
f.extract(literal("day"), f.to_timestamp(col('"Total"'))).alias("day")
88+
)
89+
8990
String
9091
------
9192

0 commit comments

Comments
 (0)