jens-scheffler-bosch commented on code in PR #30706:
URL: https://github.com/apache/airflow/pull/30706#discussion_r1193199224


##########
airflow/jobs/scheduler_job_runner.py:
##########
@@ -1308,8 +1308,18 @@ def _create_dag_runs_dataset_triggered(
                     DatasetDagRunQueue.target_dag_id == dag_run.dag_id
                 ).delete()
 
-    def _should_update_dag_next_dagruns(self, dag, dag_model: DagModel, 
total_active_runs: int) -> bool:
+    def _should_update_dag_next_dagruns(
+        self, dag: DAG, dag_model: DagModel, session: Session, 
total_active_runs: int = -1
+    ) -> bool:
         """Check if the dag's next_dagruns_create_after should be updated."""
+        # If dag has no interval or timetable then skip save runtime
+        if not dag.schedule_interval and isinstance(dag.timetable, 
NullTimetable):
+            return False

Review Comment:
   Hi @uranusjr Thanks (also here) for the feedback - tried to apply the change 
and renamed `can_run` to `can_be_scheduled` and checked logic where it is used 
and re-factored code pieced.
   To have an effect of the flag, `DatasetTriggeredTimetable` does not inherit 
from `NullTimetable`.
   
   PR is now way more complex than before, I hope it is not shooting in the 
wrong direction (but at least is not using `isinstance()` anymore :-D



-- 
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]

Reply via email to