ashb commented on a change in pull request #17451: URL: https://github.com/apache/airflow/pull/17451#discussion_r684097826
########## File path: docs/apache-airflow/templates-ref.rst ########## @@ -105,14 +105,35 @@ For example, you could use expressions in your templates like ``{{ conn.my_conn_ Just like with ``var`` it's possible to fetch a connection by string (e.g. ``{{ conn.get('my_conn_id_'+index).host }}`` ) or provide defaults (e.g ``{{ conn.get('my_conn_id', {"host": "host1", "login": "user1"}).host }}``) +Filters +------- + +Airflow defines the some Jinja filters that can be used to format values. + +For example, using ``{{ execution_date | ds }}`` will output the execution_date in the ``YYYY-MM-DD`` format. + +===================== ============ ================================================================== +Filter Operates on Description +===================== ============ ================================================================== +``ds`` datetime Format the datetime as ``YYYY-MM-DD`` +``ds_no_dash`` datetime Format the datetime as ``YYYYMMDD`` +``ts`` datetime Same as ``.isoformat()``, Example: ``2018-01-01T00:00:00+00:00`` +``ts_no_dash`` datetime Same as ``ts`` filter without ``-``, ``:`` or TimeZone info. + Example: ``20180101T000000`` +``ts_nodash_with_tz`` datetime As ``ts`` filter without ``-`` or ``:``. Example + ``20180101T000000+0000`` +===================== ============ ================================================================== Review comment: ```suggestion ====================== ============ ================================================================== Filter Operates on Description ====================== ============ ================================================================== ``ds`` datetime Format the datetime as ``YYYY-MM-DD`` ``ds_no_dash`` datetime Format the datetime as ``YYYYMMDD`` ``ts`` datetime Same as ``.isoformat()``, Example: ``2018-01-01T00:00:00+00:00`` ``ts_no_dash`` datetime Same as ``ts`` filter without ``-``, ``:`` or TimeZone info. Example: ``20180101T000000`` ``ts_nod|ash_with_tz`` datetime As ``ts`` filter without ``-`` or ``:``. Example ``20180101T000000+0000`` ====================== ============ ================================================================== ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org