ferruzzi commented on code in PR #51638: URL: https://github.com/apache/airflow/pull/51638#discussion_r2152902316
########## airflow-core/src/airflow/models/dag.py: ########## @@ -463,6 +464,15 @@ def validate_executor_field(self): "update the executor configuration for this task." ) + def get_dagrun_creation_deadlines(self) -> DeadlineAlert | None: + """If the DAG has a deadline related to DagRun, return it; else return None.""" + if ( + not (deadline := self.deadline) + or type(deadline.reference) not in DeadlineReference.TYPES.DAGRUN_CREATED Review Comment: Oh, I was actually looking at that last night. I'm going to switch that `if` around, it's a bit cleaner as: ``` if (deadline := self.deadline) and type(deadline.reference) in DeadlineReference.TYPES.DAGRUN_CREATED: return deadline return None ``` For `type(foo) in bar` vs `isinstance(foo, tuple(bar))`, I kinda like the easier readability of the first but don't feel strongly. I'll cast the TYPES to a tuple in their definition and switch to a more simplified version of your suggestion. -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org