-
Notifications
You must be signed in to change notification settings - Fork 16.4k
fix(external_task_sensor): fallback to execution_date key for execution_date_fn context (#52236) #52431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(external_task_sensor): fallback to execution_date key for execution_date_fn context (#52236) #52431
Conversation
…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
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
|
|
@yeswanth-bf added comment in issue, to get the log |
providers/standard/src/airflow/providers/standard/sensors/external_task.py
Outdated
Show resolved
Hide resolved
Signed-off-by: yeswanth-bf <117461015+yeswanth-bf@users.noreply.github.com>
7de1a26 to
8d48c2c
Compare
gopidesupavan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@yeswanth-bf tests are failing .. |
providers/standard/src/airflow/providers/standard/sensors/external_task.py
Show resolved
Hide resolved
|
compact tests failing, please take look at these test references: providers/standard/tests/unit/standard/operators/test_weekday.py |
|
@yeswanth-s1th do you need any help give me a shout. |
|
@yeswanth-s1th any update on the test fixes? happy to fork these changes and add you as co-author |
@gopidesupavan Thanks again for unblocking this! |
Closes #52236.
What this PR does:
_handle_execution_date_fn, triescontext['logical_date'], then the legacycontext['execution_date'], thendag_run.run_after.execution_date.This prevents a KeyError for users whose context lacks
logical_datebut still haveexecution_date.