Adding datetil to macros and documenting macros references
This commit is contained in:
Родитель
66370f9290
Коммит
8fd35adb4f
|
@ -1,6 +1,7 @@
|
|||
from __future__ import absolute_import
|
||||
from random import random
|
||||
from datetime import datetime, timedelta
|
||||
import dateutil
|
||||
import time
|
||||
from . import hive
|
||||
import uuid
|
||||
|
|
|
@ -138,7 +138,26 @@ attributes and methods.
|
|||
|
||||
Macros
|
||||
''''''
|
||||
These macros live under the ``macros`` namespace in your templates.
|
||||
Macros are a way to expose objects to your templates and live under the
|
||||
``macros`` namespace in your templates.
|
||||
|
||||
A few commonly used libraries and methods are made available.
|
||||
|
||||
================================= ====================================
|
||||
Variable Description
|
||||
================================= ====================================
|
||||
``macros.datetime`` The standard lib's
|
||||
``datetime.datetime``
|
||||
``macros.timedelta`` The standard lib's
|
||||
``datetime.timedelta``
|
||||
``macros.dateutil`` A reference to the ``dateutil``
|
||||
package
|
||||
``macros.time`` The standard lib's ``time``
|
||||
``macros.uuid`` The standard lib's ``uuid``
|
||||
``macros.random`` The standard lib's ``random``
|
||||
================================= ====================================
|
||||
|
||||
Some airflow specific macros are also defined:
|
||||
|
||||
.. automodule:: airflow.macros
|
||||
:show-inheritance:
|
||||
|
|
Загрузка…
Ссылка в новой задаче