Skip to content

Commit

Permalink
fixup! Issue #332 simplify "next" page handling
Browse files Browse the repository at this point in the history
  • Loading branch information
soxofaan committed Dec 5, 2024
1 parent 01a6246 commit ef6fb2d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion openeo_driver/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ class JobListing:
(e.g. including pagination)
"""

# TODO: just implement as frozen dataclass, or does that conflict with later need to subclass?
# TODO #332 just implement as frozen dataclass, or does that conflict with later need to subclass?
__slots__ = ["_jobs", "_next_parameters"]

def __init__(self, jobs: List[BatchJobMetadata], next_parameters: Optional[dict] = None):
Expand Down
8 changes: 4 additions & 4 deletions openeo_driver/jobregistry.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def _do_request(
url = url_join(self._api_url, path)
self.logger.debug(f"Doing EJR request `{method} {url}` {params=} {headers.keys()=}")
if self._debug_show_curl:
# TODO: add params to curl command
# TODO #332 add params to curl command
curl_command = self._as_curl(method=method, url=url, data=json, headers=headers)
self.logger.debug(f"Equivalent curl command: {curl_command}")
try:
Expand Down Expand Up @@ -611,7 +611,7 @@ def _search_paginated(
) -> PaginatedSearchResult:
fields = set(fields or [])
# Make sure to include some basic fields by default
# TODO: avoid duplication of this default field set
# TODO #332 avoid duplication of this default field set
fields.update(["job_id", "user_id", "created", "status", "updated"])
params = {}
if page_size:
Expand Down Expand Up @@ -672,7 +672,7 @@ def list_user_jobs(

if limit:
# Do paginated search
# TODO: make this the one and only code path
# TODO #332 make this the one and only code path
page_number = (request_parameters or {}).get(self.PAGINATION_URL_PARAM)
if page_number:
page_number = int(page_number)
Expand All @@ -685,7 +685,7 @@ def list_user_jobs(
)
else:
# Deprecated non-paginated search
# TODO: eliminate this code path
# TODO #332 eliminate this code path
return self._search(query=query, fields=fields)

def list_active_jobs(
Expand Down

0 comments on commit ef6fb2d

Please sign in to comment.