From 974022b198b8d50fe52bc389e77a738eba40d877 Mon Sep 17 00:00:00 2001 From: Bas Harenslak Date: Mon, 5 Aug 2019 19:40:36 +0200 Subject: [PATCH] [AIRFLOW-4192] Remove end_date and latest_date from task context --- UPDATING.md | 7 +++++++ airflow/models/taskinstance.py | 2 -- docs/macros.rst | 2 -- tests/cli/test_cli.py | 1 - 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/UPDATING.md b/UPDATING.md index 02fd7c4f4bbd7..b841e64864076 100644 --- a/UPDATING.md +++ b/UPDATING.md @@ -23,6 +23,13 @@ assists users migrating to a new version. ## Airflow Master +### Variables removed from the task instance context + +The following variables were removed from the task instance context: +- end_date +- latest_date +- tables + ### Moved provide_gcp_credential_file decorator to GoogleCloudBaseHook To simplify the code, the decorator has been moved from the inner-class. diff --git a/airflow/models/taskinstance.py b/airflow/models/taskinstance.py index 67febbbf01bbd..8d9af306a4ec7 100644 --- a/airflow/models/taskinstance.py +++ b/airflow/models/taskinstance.py @@ -1202,10 +1202,8 @@ def __repr__(self): 'dag_run': dag_run, 'ds': ds, 'ds_nodash': ds_nodash, - 'end_date': ds, 'execution_date': pendulum.instance(self.execution_date), 'inlets': task.inlets, - 'latest_date': ds, 'macros': macros, 'next_ds': next_ds, 'next_ds_nodash': next_ds_nodash, diff --git a/docs/macros.rst b/docs/macros.rst index 046963553a207..56dc7d5d370e9 100644 --- a/docs/macros.rst +++ b/docs/macros.rst @@ -57,8 +57,6 @@ Variable Description ``{{ task }}`` the Task object ``{{ macros }}`` a reference to the macros package, described below ``{{ task_instance }}`` the task_instance object -``{{ end_date }}`` same as ``{{ ds }}`` -``{{ latest_date }}`` same as ``{{ ds }}`` ``{{ ti }}`` same as ``{{ task_instance }}`` ``{{ params }}`` a reference to the user-defined params dictionary which can be overridden by the dictionary passed through ``trigger_dag -c`` if you enabled diff --git a/tests/cli/test_cli.py b/tests/cli/test_cli.py index 5b1d32e05fb91..091e2581f28f6 100644 --- a/tests/cli/test_cli.py +++ b/tests/cli/test_cli.py @@ -204,7 +204,6 @@ def test_test(self): output = out.getvalue() # Check that prints, and log messages, are shown - self.assertIn('end_date', output) self.assertIn("'example_python_operator__print_the_context__20180101'", output) finally: sys.stdout = saved_stdout