From a147dcdefb2899023d40fe575aceec175ec81229 Mon Sep 17 00:00:00 2001 From: Nicholas Schrock Date: Thu, 24 Aug 2023 07:07:45 -0700 Subject: [PATCH] cp --- .../dagster/dagster/_core/definitions/schedule_definition.py | 2 +- .../dagster/_core/execution/context/dual_state_context.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python_modules/dagster/dagster/_core/definitions/schedule_definition.py b/python_modules/dagster/dagster/_core/definitions/schedule_definition.py index 4630e0d59c67a..b2acffcde9f21 100644 --- a/python_modules/dagster/dagster/_core/definitions/schedule_definition.py +++ b/python_modules/dagster/dagster/_core/definitions/schedule_definition.py @@ -248,7 +248,7 @@ def merge_resources(self, resources_dict: Mapping[str, Any]) -> "ScheduleEvaluat resources_dict (Mapping[str, Any]): The resources to replace in the context. """ check.invariant( - not self._resources_container.has_been_accessed, + not self._resources_container.cm_scope_entered, "Cannot merge resources in context that has been initialized.", ) from dagster._core.execution.build_resources import wrap_resources_for_execution diff --git a/python_modules/dagster/dagster/_core/execution/context/dual_state_context.py b/python_modules/dagster/dagster/_core/execution/context/dual_state_context.py index 57e6464e990c9..efea48fbd3101 100644 --- a/python_modules/dagster/dagster/_core/execution/context/dual_state_context.py +++ b/python_modules/dagster/dagster/_core/execution/context/dual_state_context.py @@ -31,7 +31,7 @@ def __init__( resources_dict_or_resources_obj: Optional[Union[Mapping[str, Any], Resources]], resources_config: Optional[Mapping[str, Any]] = None, ): - self._cm_scope_entered = False + self.cm_scope_entered = False self._exit_stack = ExitStack() self._resources_config = resources_config @@ -49,7 +49,7 @@ def __init__( self._resources = ScopedResourcesBuilder.build_empty() def call_on_enter(self) -> None: - self._cm_scope_entered = True + self.cm_scope_entered = True def call_on_exit(self) -> None: self._exit_stack.close()