@@ -394,7 +394,7 @@ def run(
394394 execution_time : t .Optional [TimeLike ] = None ,
395395 skip_janitor : bool = False ,
396396 ignore_cron : bool = False ,
397- ) -> None :
397+ ) -> bool :
398398 """Run the entire dag through the scheduler.
399399
400400 Args:
@@ -404,13 +404,16 @@ def run(
404404 execution_time: The date/time time reference to use for execution time. Defaults to now.
405405 skip_janitor: Whether to skip the janitor task.
406406 ignore_cron: Whether to ignore the model's cron schedule and run all available missing intervals.
407+
408+ Returns:
409+ True if the run was successful, False otherwise.
407410 """
408411 environment = environment or c .PROD
409412 self .notification_target_manager .notify (
410413 NotificationEvent .RUN_START , environment = environment
411414 )
412415 try :
413- self .scheduler (environment = environment ).run (
416+ success = self .scheduler (environment = environment ).run (
414417 environment ,
415418 start = start ,
416419 end = end ,
@@ -422,11 +425,21 @@ def run(
422425 NotificationEvent .RUN_FAILURE , traceback .format_exc ()
423426 )
424427 raise e
425- self .notification_target_manager .notify (NotificationEvent .RUN_END , environment = environment )
428+ if success :
429+ self .notification_target_manager .notify (
430+ NotificationEvent .RUN_END , environment = environment
431+ )
432+ else :
433+ self .notification_target_manager .notify (
434+ NotificationEvent .RUN_FAILURE , environment = environment
435+ )
436+ return success
426437
427438 if not skip_janitor and environment .lower () == c .PROD :
428439 self ._run_janitor ()
429440
441+ return success
442+
430443 @t .overload
431444 def get_model (
432445 self , model_or_snapshot : ModelOrSnapshot , raise_if_missing : Literal [True ] = True
0 commit comments