Skip to content

Conversation

@gopidesupavan
Copy link
Member

@gopidesupavan gopidesupavan commented Jul 24, 2025

closes #52236
closes #52236
cherry-picked changes from #52431


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

yeswanth-s1th and others added 18 commits June 28, 2025 16:10
…on_date_fn context - Try context['logical_date'], then context['execution_date'], then dag_run.run_after - Prevents KeyError when users run in environments without 'logical_date' Closes apache#52236

fix(external_task_sensor): fallback to execution_date key for execution_date_fn context
- Try context['logical_date'], then context['execution_date'], then dag_run.run_after
- Prevents KeyError when users run in environments without 'logical_date'
Closes apache#52236
Signed-off-by: yeswanth-bf <117461015+yeswanth-bf@users.noreply.github.com>
@gopidesupavan
Copy link
Member Author

cc: @yeswanth-s1th

@gopidesupavan gopidesupavan requested a review from shahar1 July 25, 2025 08:12
@gopidesupavan gopidesupavan merged commit 4761082 into apache:main Jul 26, 2025
102 checks passed
ferruzzi pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Aug 7, 2025
…ache#53728)

* fix(external_task_sensor): fallback to execution_date key for execution_date_fn context - Try context['logical_date'], then context['execution_date'], then dag_run.run_after - Prevents KeyError when users run in environments without 'logical_date' Closes apache#52236

fix(external_task_sensor): fallback to execution_date key for execution_date_fn context
- Try context['logical_date'], then context['execution_date'], then dag_run.run_after
- Prevents KeyError when users run in environments without 'logical_date'
Closes apache#52236

* test: alias stdlib datetime to dt to avoid shadowing timezone datetime

* chore: apply blank-line fix to docstring and add logical_date tests

Signed-off-by: yeswanth-bf <117461015+yeswanth-bf@users.noreply.github.com>

* Update external_task.py

* Fix key error in _handle_execution_date_fn for ExternalTaskSensor

* Fix tests

---------

Signed-off-by: yeswanth-bf <117461015+yeswanth-bf@users.noreply.github.com>
Co-authored-by: yeswanth-bf <117461015+yeswanth-bf@users.noreply.github.com>
Co-authored-by: Yeswanth Surampudi <117461015+yeswanth-s1th@users.noreply.github.com>
fweilun pushed a commit to fweilun/airflow that referenced this pull request Aug 11, 2025
…ache#53728)

* fix(external_task_sensor): fallback to execution_date key for execution_date_fn context - Try context['logical_date'], then context['execution_date'], then dag_run.run_after - Prevents KeyError when users run in environments without 'logical_date' Closes apache#52236

fix(external_task_sensor): fallback to execution_date key for execution_date_fn context
- Try context['logical_date'], then context['execution_date'], then dag_run.run_after
- Prevents KeyError when users run in environments without 'logical_date'
Closes apache#52236

* test: alias stdlib datetime to dt to avoid shadowing timezone datetime

* chore: apply blank-line fix to docstring and add logical_date tests

Signed-off-by: yeswanth-bf <117461015+yeswanth-bf@users.noreply.github.com>

* Update external_task.py

* Fix key error in _handle_execution_date_fn for ExternalTaskSensor

* Fix tests

---------

Signed-off-by: yeswanth-bf <117461015+yeswanth-bf@users.noreply.github.com>
Co-authored-by: yeswanth-bf <117461015+yeswanth-bf@users.noreply.github.com>
Co-authored-by: Yeswanth Surampudi <117461015+yeswanth-s1th@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Key Error in External Task Sensor when using execution_date_fn

3 participants