potiuk commented on code in PR #76110: URL: https://github.com/apache/airflow/pull/76110#discussion_r4435956254
########## airflow-core/newsfragments/76110.feature.rst: ########## @@ -0,0 +1 @@ +The callback context now includes a ``callback`` key whose ``source`` field tells you whether the callback ran at the Dag level or the task level. Review Comment: **In airflow-core/ use only significant newsfragments** > In `airflow-core/` use only `significant` newsfragments, and only for a change users must read before upgrading: a behavior change, a removal or a new default, or migration steps. [...] Never add one for an ordinary bug fix, feature, improvement or doc change This is a new feature rather than something users must read before upgrading, so this newsfragment should be dropped; the release notes pick the change up from the PR. ########## task-sdk/src/airflow/sdk/definitions/context.py: ########## @@ -18,10 +18,35 @@ from __future__ import annotations import copy +import enum import os from collections.abc import MutableMapping from typing import TYPE_CHECKING, Any, NamedTuple, NotRequired, TypedDict, cast + +class CallbackSource(str, enum.Enum): + """Whether a callback was triggered at the DAG level or the task level.""" Review Comment: **Write Dag (title case) in all prose** > Write **Dag** (title case) in all prose. Keep the all-caps or lowercase spelling only when reproducing a literal code token "Dag level" here, and "defined on the Dag" in the `CallbackMeta` docstring below. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
