From f8d96177a25885af181b21808fd64b541129f84e Mon Sep 17 00:00:00 2001 From: Owen Kephart Date: Wed, 9 Oct 2024 17:27:56 -0700 Subject: [PATCH] Add `all_deps_blocking_checks_passed` condition --- .../declarative_automation/automation_condition.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/python_modules/dagster/dagster/_core/definitions/declarative_automation/automation_condition.py b/python_modules/dagster/dagster/_core/definitions/declarative_automation/automation_condition.py index b92b0cc523ef6..f8d54fcdda352 100644 --- a/python_modules/dagster/dagster/_core/definitions/declarative_automation/automation_condition.py +++ b/python_modules/dagster/dagster/_core/definitions/declarative_automation/automation_condition.py @@ -523,6 +523,20 @@ def any_deps_in_progress() -> "AnyDepsCondition": "any_deps_in_progress" ) + @experimental + @staticmethod + def all_deps_blocking_checks_passed() -> "AllDepsCondition": + """Returns an AutomationCondition that is true for any partition where all upstream + blocking checks have passed, or will be requested. + """ + with disable_dagster_warnings(): + return AutomationCondition.all_deps_match( + AutomationCondition.all_checks_match( + AutomationCondition.check_passed() | AutomationCondition.will_be_requested(), + blocking_only=True, + ).with_label("all_blocking_checks_passed") + ).with_label("all_deps_blocking_checks_passed") + @experimental @staticmethod def all_deps_updated_since_cron(