Skip to content

Commit

Permalink
fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
schrockn committed Sep 15, 2023
1 parent 0564a92 commit 3ecd87e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ def resources(self) -> Resources:
"""Mapping of resource key to resource definition to be made available
during schedule execution.
"""
if self._resources_container.has_resources:
return self._resources_container.get_resources()
if self._resources_container.has_been_accessed:
return self._resources_container.get_already_accessed_resources()

instance = self.instance if self._instance or self._instance_ref else None
return self._resources_container.make_resources("build_schedule_context", instance=instance)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,12 @@ def call_on_exit(self) -> None:
def call_on_del(self) -> None:
self._exit_stack.close()

@property
def has_been_accessed(self) -> bool:
return self._resources is not None

def has_resources(self) -> bool:
return bool(self._resources)

def get_resources(self) -> Resources:
assert self.has_resources
def get_already_accessed_resources(self) -> Resources:
check.invariant(self.has_been_accessed)
return check.not_none(self._resources)

def make_resources(
Expand Down

0 comments on commit 3ecd87e

Please sign in to comment.