ashb commented on code in PR #51638:
URL: https://github.com/apache/airflow/pull/51638#discussion_r2147474950
##########
airflow-core/src/airflow/models/dagrun.py:
##########
@@ -67,9 +67,10 @@
from airflow.configuration import conf as airflow_conf
from airflow.exceptions import AirflowException, TaskNotFound
from airflow.listeners.listener import get_listener_manager
-from airflow.models import Log
+from airflow.models import Deadline, Log
Review Comment:
We shouldn't be adding new "convince" imports to airflow.models (as those
were mostly there for users/dag authors in the 2.x era) but import directly
from the sub module
##########
airflow-core/src/airflow/models/dag.py:
##########
@@ -1613,6 +1623,22 @@ def create_dagrun(
session=session,
)
+ if dag_deadline := self.get_dagrun_creation_deadlines():
+ Deadline.add_deadline(
Review Comment:
Given all those method does is session.add I would rather we did that
directly here. Airflow devs know what session.add does via having an extra
method in the way introduces extra cognitive load of "what does this actually
do?"
--
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]