ashb commented on a change in pull request #16352:
URL: https://github.com/apache/airflow/pull/16352#discussion_r683362607
##########
File path: airflow/www/views.py
##########
@@ -1602,7 +1602,7 @@ def trigger(self, session=None):
'airflow/trigger.html', dag_id=dag_id, origin=origin,
conf=request_conf, form=form
)
- dag = current_app.dag_bag.get_dag(dag_id)
+ dag: DAG = current_app.dag_bag.get_dag(dag_id)
Review comment:
```suggestion
dag = current_app.dag_bag.get_dag(dag_id)
```
Revert this as we don't otherwise touch this file.
##########
File path: docs/apache-airflow/macros-ref.rst
##########
@@ -35,28 +35,23 @@ in all templates
===================================== ====================================
Variable Description
===================================== ====================================
-``{{ ds }}`` the execution date as ``YYYY-MM-DD``
-``{{ ds_nodash }}`` the execution date as ``YYYYMMDD``
-``{{ prev_ds }}`` the previous execution date as
``YYYY-MM-DD``
- if ``{{ ds }}`` is ``2018-01-08`` and
``schedule_interval`` is ``@weekly``,
- ``{{ prev_ds }}`` will be
``2018-01-01``
-``{{ prev_ds_nodash }}`` the previous execution date as
``YYYYMMDD`` if exists, else ``None``
-``{{ next_ds }}`` the next execution date as
``YYYY-MM-DD``
- if ``{{ ds }}`` is ``2018-01-01`` and
``schedule_interval`` is ``@weekly``,
- ``{{ next_ds }}`` will be
``2018-01-08``
-``{{ next_ds_nodash }}`` the next execution date as
``YYYYMMDD`` if exists, else ``None``
-``{{ yesterday_ds }}`` the day before the execution date as
``YYYY-MM-DD``
-``{{ yesterday_ds_nodash }}`` the day before the execution date as
``YYYYMMDD``
-``{{ tomorrow_ds }}`` the day after the execution date as
``YYYY-MM-DD``
-``{{ tomorrow_ds_nodash }}`` the day after the execution date as
``YYYYMMDD``
-``{{ ts }}`` same as
``execution_date.isoformat()``. Example: ``2018-01-01T00:00:00+00:00``
+``{{ logical_date }}`` the logical date of the DAG run
(`pendulum.Pendulum`_)
+``{{ ds }}`` the logical date as ``YYYY-MM-DD``
+``{{ ds_nodash }}`` the logical date as ``YYYYMMDD``
+``{{ ts }}`` same as ``schedule_date.isoformat()``.
Example: ``2018-01-01T00:00:00+00:00``
``{{ ts_nodash }}`` same as ``ts`` without ``-``, ``:``
and TimeZone info. Example: ``20180101T000000``
``{{ ts_nodash_with_tz }}`` same as ``ts`` without ``-`` and
``:``. Example: ``20180101T000000+0000``
-``{{ execution_date }}`` the execution_date (logical date)
(`pendulum.Pendulum`_)
-``{{ prev_execution_date }}`` the previous execution date (if
available) (`pendulum.Pendulum`_)
-``{{ prev_execution_date_success }}`` execution date from prior successful
dag run (if available) (`pendulum.Pendulum`_)
+``{{ next_logical_date }}`` the next logical date if exists
(`pendulum.Pendulum`_ or ``None``)
+``{{ next_ds }}`` the next logical date as ``YYYY-MM-DD``
+ if ``{{ ds }}`` is ``2018-01-01`` and
``schedule_interval`` is ``@weekly``,
+ ``{{ next_ds }}`` will be
``2018-01-08``
+``{{ next_ds_nodash }}`` the next schedule date as ``YYYYMMDD``
if exists, else ``None``
Review comment:
```suggestion
``{{ next_ds_nodash }}`` the next logical date as
``YYYYMMDD`` if exists, else ``None``
```
##########
File path: docs/apache-airflow/macros-ref.rst
##########
@@ -83,6 +78,27 @@ Variable Description
the CLI's test subcommand
===================================== ====================================
+The following variables are deprecated. They are kept for backward
compatibility,
+but you should convert existing code to use other variables instead.
+
+===================================== ====================================
+Deprecated Variable Description
+===================================== ====================================
+``{{ execution_date }}`` the execution date (logical date),
same as ``logical_date``
+``{{ prev_ds }}`` the previous execution date as
``YYYY-MM-DD``
+ if ``{{ ds }}`` is ``2018-01-08`` and
``schedule_interval`` is ``@weekly``,
+ ``{{ prev_ds }}`` will be
``2018-01-01``
+``{{ prev_ds_nodash }}`` the previous execution date as
``YYYYMMDD`` if exists, else ``None``
+``{{ yesterday_ds }}`` the day before the execution date as
``YYYY-MM-DD``
+``{{ yesterday_ds_nodash }}`` the day before the execution date as
``YYYYMMDD``
+``{{ tomorrow_ds }}`` the day after the execution date as
``YYYY-MM-DD``
+``{{ tomorrow_ds_nodash }}`` the day after the execution date as
``YYYYMMDD``
+``{{ prev_execution_date }}`` the previous execution date (if
available) (`pendulum.Pendulum`_)
+``{{ prev_execution_date_success }}`` execution date from prior successful
dag run,
+ same as ``prev_logical_date_success``
+``{{ next_execution_date }}`` the next execution date, same as
``next_logical_date``
Review comment:
```suggestion
``{{ next_execution_date }}`` the next execution date, same as
``data_interval_env``
```
(Yes, it would be the same, but I think we should point people to use the
explicit data interval properties)
##########
File path: docs/apache-airflow/macros-ref.rst
##########
@@ -35,28 +35,23 @@ in all templates
===================================== ====================================
Variable Description
===================================== ====================================
-``{{ ds }}`` the execution date as ``YYYY-MM-DD``
-``{{ ds_nodash }}`` the execution date as ``YYYYMMDD``
-``{{ prev_ds }}`` the previous execution date as
``YYYY-MM-DD``
- if ``{{ ds }}`` is ``2018-01-08`` and
``schedule_interval`` is ``@weekly``,
- ``{{ prev_ds }}`` will be
``2018-01-01``
-``{{ prev_ds_nodash }}`` the previous execution date as
``YYYYMMDD`` if exists, else ``None``
-``{{ next_ds }}`` the next execution date as
``YYYY-MM-DD``
- if ``{{ ds }}`` is ``2018-01-01`` and
``schedule_interval`` is ``@weekly``,
- ``{{ next_ds }}`` will be
``2018-01-08``
-``{{ next_ds_nodash }}`` the next execution date as
``YYYYMMDD`` if exists, else ``None``
-``{{ yesterday_ds }}`` the day before the execution date as
``YYYY-MM-DD``
-``{{ yesterday_ds_nodash }}`` the day before the execution date as
``YYYYMMDD``
-``{{ tomorrow_ds }}`` the day after the execution date as
``YYYY-MM-DD``
-``{{ tomorrow_ds_nodash }}`` the day after the execution date as
``YYYYMMDD``
-``{{ ts }}`` same as
``execution_date.isoformat()``. Example: ``2018-01-01T00:00:00+00:00``
+``{{ logical_date }}`` the logical date of the DAG run
(`pendulum.Pendulum`_)
+``{{ ds }}`` the logical date as ``YYYY-MM-DD``
+``{{ ds_nodash }}`` the logical date as ``YYYYMMDD``
+``{{ ts }}`` same as ``schedule_date.isoformat()``.
Example: ``2018-01-01T00:00:00+00:00``
Review comment:
```suggestion
``{{ ts }}`` same as
``logical_date.isoformat()``. Example: ``2018-01-01T00:00:00+00:00``
```
But see previous comment about deriving form data interval.
##########
File path: docs/apache-airflow/macros-ref.rst
##########
@@ -35,28 +35,23 @@ in all templates
===================================== ====================================
Variable Description
===================================== ====================================
-``{{ ds }}`` the execution date as ``YYYY-MM-DD``
-``{{ ds_nodash }}`` the execution date as ``YYYYMMDD``
-``{{ prev_ds }}`` the previous execution date as
``YYYY-MM-DD``
- if ``{{ ds }}`` is ``2018-01-08`` and
``schedule_interval`` is ``@weekly``,
- ``{{ prev_ds }}`` will be
``2018-01-01``
-``{{ prev_ds_nodash }}`` the previous execution date as
``YYYYMMDD`` if exists, else ``None``
-``{{ next_ds }}`` the next execution date as
``YYYY-MM-DD``
- if ``{{ ds }}`` is ``2018-01-01`` and
``schedule_interval`` is ``@weekly``,
- ``{{ next_ds }}`` will be
``2018-01-08``
-``{{ next_ds_nodash }}`` the next execution date as
``YYYYMMDD`` if exists, else ``None``
-``{{ yesterday_ds }}`` the day before the execution date as
``YYYY-MM-DD``
-``{{ yesterday_ds_nodash }}`` the day before the execution date as
``YYYYMMDD``
-``{{ tomorrow_ds }}`` the day after the execution date as
``YYYY-MM-DD``
-``{{ tomorrow_ds_nodash }}`` the day after the execution date as
``YYYYMMDD``
-``{{ ts }}`` same as
``execution_date.isoformat()``. Example: ``2018-01-01T00:00:00+00:00``
+``{{ logical_date }}`` the logical date of the DAG run
(`pendulum.Pendulum`_)
+``{{ ds }}`` the logical date as ``YYYY-MM-DD``
Review comment:
I think this should be derrived from data_interval_start, rather than
logical date.
Previously the implicit data interval was
exection_date...next_exectuion_date
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]