uranusjr commented on code in PR #39165:
URL: https://github.com/apache/airflow/pull/39165#discussion_r1670078646
##########
airflow/utils/types.py:
##########
@@ -72,3 +72,18 @@ class EdgeInfoType(TypedDict):
"""Extra metadata that the DAG can store about an edge, usually generated
from an EdgeModifier."""
label: str | None
+
+
+class DagRunTriggeredByType(str, enum.Enum):
+ """Class with TriggeredBy types for DagRun."""
+
+ CLI = "cli" # for the trigger subcommand for dag command in cli: airflow
dags trigger
+ OPERATOR = "operator" # for the TriggerDagRunOperator
+ REST_API = "rest_api" # for triggering the DAG via RESTful API
+ UI = "ui" # for clicking the `Trigger DAG` button
+ TEST = "test" # for dag.test()
+ SCHEDULER = "scheduler" # for scheduler
Review Comment:
Your interpretation is not wrong, but the problem is that both
timetable-related and database-related triggering are ultimately done by the
scheduler, so this name is confusing. Some parts of Airflow use “scheduler” to
refer to (only) timetable-related scheduling because historically that was the
only way to schedule things; datasets were introduced later. We don’t need to
follow the naming. Even if we keep the `SCHEDULER` variable—I don’t think we
should—a better comment is still needed to explain this does not cover
dataset-triggered runs.
--
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]