This is an automated email from the ASF dual-hosted git repository.
shahar pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new f85c881ce33 Guide users away from deprecated datetime macros (#60046)
f85c881ce33 is described below
commit f85c881ce33371b3e1ecbed00b86ca6286f9a16b
Author: Harrold Mussa <[email protected]>
AuthorDate: Sat Jan 3 09:53:36 2026 +0100
Guide users away from deprecated datetime macros (#60046)
---
airflow-core/docs/templates-ref.rst | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/airflow-core/docs/templates-ref.rst
b/airflow-core/docs/templates-ref.rst
index 0cbd8bf29c8..c5f3df4dde6 100644
--- a/airflow-core/docs/templates-ref.rst
+++ b/airflow-core/docs/templates-ref.rst
@@ -175,16 +175,17 @@ Macros are a way to expose objects to your templates and
live under the
A few commonly used libraries and methods are made available.
-=================================
==============================================
+=================================
========================================================================================================================================================================
Variable Description
-=================================
==============================================
-``macros.datetime`` The standard lib's
:class:`datetime.datetime`
+=================================
========================================================================================================================================================================
+``macros.datetime`` The standard lib's
:class:`datetime.datetime`.
+ Note: ``utcnow()`` is deprecated in Python
3.12+; use ``now(macros.dateutil.tz.UTC)`` instead.
``macros.timedelta`` The standard lib's
:class:`datetime.timedelta`
``macros.dateutil`` A reference to the ``dateutil`` package
``macros.time`` The standard lib's :mod:`time`
``macros.uuid`` The standard lib's :mod:`uuid`
``macros.random`` The standard lib's :class:`random.random`
-=================================
==============================================
+=================================
========================================================================================================================================================================
Some Airflow specific macros are also defined: