Skip to content

bugfix: Enforce and document context injection into custom callbacks#62649

Merged
ferruzzi merged 5 commits intoapache:mainfrom
aws-mwaa:ferruzzi/executor-callbacks/fix-context
Mar 5, 2026
Merged

bugfix: Enforce and document context injection into custom callbacks#62649
ferruzzi merged 5 commits intoapache:mainfrom
aws-mwaa:ferruzzi/executor-callbacks/fix-context

Conversation

@ferruzzi
Copy link
Contributor

Found a bug while manual testing deadline alerts. We are now injecting context into custom callbacks, but if the user didn't add context or **kwargs to their custom callback, it will fail with an unexpected parameter exception. We can either document that all custom callbacks need that, or we can add guardrails so context is only provided if it is supported. I figured the latter was more robust and safer. New code filters parameters going into any custom callback to only provide parameters it expects.


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@ferruzzi
Copy link
Contributor Author

followup to #61153

@ferruzzi ferruzzi merged commit 4b99ae8 into apache:main Mar 5, 2026
72 checks passed
@ferruzzi ferruzzi deleted the ferruzzi/executor-callbacks/fix-context branch March 5, 2026 00:21
1Ninad pushed a commit to 1Ninad/airflow that referenced this pull request Mar 6, 2026
…pache#62649)

* Enforce and document context injection into custom callbacks
dominikhei pushed a commit to dominikhei/airflow that referenced this pull request Mar 11, 2026
…pache#62649)

* Enforce and document context injection into custom callbacks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:deadline-alerts AIP-86 (former AIP-57) area:Executors-core LocalExecutor & SequentialExecutor kind:documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants