From 37bc8af507d06905b96ad2642fcf96d5095c5803 Mon Sep 17 00:00:00 2001 From: Ajay9704 Date: Thu, 26 Feb 2026 12:38:08 +0530 Subject: [PATCH] emplate_variable_start_date_doesnt_exist --- airflow-core/docs/templates-ref.rst | 3 +-- scripts/ci/prek/check_template_context_variable_in_sync.py | 2 +- task-sdk/src/airflow/sdk/definitions/context.py | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/airflow-core/docs/templates-ref.rst b/airflow-core/docs/templates-ref.rst index 2d9aaec2f291d..c908e03da9411 100644 --- a/airflow-core/docs/templates-ref.rst +++ b/airflow-core/docs/templates-ref.rst @@ -70,8 +70,7 @@ Variable Type Description ``{{ prev_start_date_success }}`` `pendulum.DateTime`_ Start date from prior successful :class:`~airflow.models.dagrun.DagRun` (if available). | ``None`` ``{{ prev_end_date_success }}`` `pendulum.DateTime`_ End date from prior successful :class:`~airflow.models.dagrun.DagRun` (if available). - | ``None`` -``{{ start_date }}`` `pendulum.DateTime`_ Datetime of when current task has been started. + | ``None`` ``{{ inlets }}`` list List of inlets declared on the task. ``{{ inlet_events }}`` dict[str, ...] Access past events of inlet assets. See :doc:`Assets `. Added in version 2.10. ``{{ outlets }}`` list List of outlets declared on the task. diff --git a/scripts/ci/prek/check_template_context_variable_in_sync.py b/scripts/ci/prek/check_template_context_variable_in_sync.py index 1d78b9d7242e2..61f4445f274f1 100755 --- a/scripts/ci/prek/check_template_context_variable_in_sync.py +++ b/scripts/ci/prek/check_template_context_variable_in_sync.py @@ -154,7 +154,7 @@ def _compare_keys(retn_keys: set[str], hint_keys: set[str], docs_keys: set[str]) docs_keys.update(("exception", "reason", "try_number")) # Airflow 3 added: - retn_keys.update(("start_date", "task_reschedule_count")) + retn_keys.add("task_reschedule_count") check_candidates = [ ("get_template_context()", retn_keys), diff --git a/task-sdk/src/airflow/sdk/definitions/context.py b/task-sdk/src/airflow/sdk/definitions/context.py index ba4d9b659054a..fe48b8558c1fa 100644 --- a/task-sdk/src/airflow/sdk/definitions/context.py +++ b/task-sdk/src/airflow/sdk/definitions/context.py @@ -65,7 +65,6 @@ class Context(TypedDict, total=False): prev_end_date_success: NotRequired[DateTime | None] reason: NotRequired[str | None] run_id: str - start_date: DateTime # TODO: Remove Operator from below once we have MappedOperator to the Task SDK # and once we can remove context related code from the Scheduler/models.TaskInstance task: BaseOperator | Operator