Skip to content

Commit

Permalink
Remove pass-through argument for cached_status.
Browse files Browse the repository at this point in the history
  • Loading branch information
bdice committed Dec 31, 2020
1 parent 3a96772 commit 97fe188
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions flow/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -2033,17 +2033,11 @@ def scheduler_jobs(self, scheduler):
"""
yield from self._expand_bundled_jobs(scheduler.jobs())

def _get_cached_status(self, cached_status=None):
def _get_cached_status(self):
"""Fetch all status information.
If the provided ``cached_status`` is not None, it is directly
returned. Otherwise, the project document key ``_status`` is
returned.
Parameters
----------
cached_status : dict
Existing cached status information. (Default value = None)
The project document key ``_status`` is returned as a plain dict, or an
empty dict if no status information is present.
Returns
-------
Expand All @@ -2053,8 +2047,6 @@ def _get_cached_status(self, cached_status=None):
:class:`~.JobStatus`.
"""
if cached_status is not None:
return cached_status
try:
return self.document["_status"]()
except KeyError:
Expand Down Expand Up @@ -2122,7 +2114,8 @@ def get_job_status(self, job, ignore_errors=False, cached_status=None):
"""
# TODO: Add support for aggregates for this method.
cached_status = self._get_cached_status(cached_status)
if cached_status is None:
cached_status = self._get_cached_status()
result = {}
result["job_id"] = str(job)
try:
Expand Down

0 comments on commit 97fe188

Please sign in to comment.