Remove incorrect start_date template variable from documentation, TypedDict, and template context validation#62505
Open
Ajay9704 wants to merge 5 commits intoapache:mainfrom
Open
Conversation
Contributor
Author
Contributor
Author
|
@kaxil, @jscheffl, @jason810496, @potiuk — whenever you get some time, please review my PR and let me know if anything is pending from my end. |
jscheffl
approved these changes
Mar 1, 2026
Contributor
jscheffl
left a comment
There was a problem hiding this comment.
OK for me but request another pair of eyes before merge.
obarisk
reviewed
Mar 3, 2026
|
|
||
| # Airflow 3 added: | ||
| retn_keys.update(("start_date", "task_reschedule_count")) | ||
| retn_keys.add("task_reschedule_count") |
Contributor
There was a problem hiding this comment.
what't the difference between add and update?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Description
This pull request removes the start_date template variable from all locations where it was still referenced even though it was intentionally removed from the runtime template context in commit 518287c (“Runtime context shouldn't have start_date as a key (#46961)”).
Background
Although the runtime context produced by get_template_context() no longer includes the start_date field, the following components continued to reference it:
airflow-core/docs/templates-ref.rst
task-sdk/src/airflow/sdk/definitions/context.py (Context TypedDict)
scripts/ci/prek/check_template_context_variable_in_sync.py
Because of this mismatch, users following the documentation and using {{ start_date }} encounter a KeyError at runtime. This issue was reported in Issue #62457, and after discussion in the thread, consensus was reached on resolving the problem by removing the variable across all remaining references.
Summary of Changes
This pull request implements Option A from the issue discussion by ensuring all components reflect the correct behavior:
Removed {{ start_date }} from the template reference documentation.
Removed the start_date entry from the Context TypedDict.
Removed start_date from the template context validation logic.
These changes ensure that documentation, type definitions, and validation checks now match the actual runtime context.
Verification
Documentation was rebuilt locally to ensure the following:
Prior to the fix, the template reference displayed start_date.
After applying this change set, the rebuilt documentation correctly excludes the variable.
This confirms the consistency of documentation with the current runtime behavior.
Related Issue
Closes: #62457
Was generative AI tooling used to co-author this PR?
NO(please specify the tool below)