Skip to content

Commit

Permalink
fixes breaking change added to search_generator caused by list type h…
Browse files Browse the repository at this point in the history
…inting
  • Loading branch information
kim committed Aug 28, 2023
1 parent 6174cef commit 93a37a6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions asf_search/search/search_generator.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import logging
from typing import Generator, Union, Iterable, Tuple
from typing import Generator, Union, Iterable, Tuple, List
from copy import copy
from requests.exceptions import HTTPError
from requests import ReadTimeout, Response
Expand All @@ -19,7 +19,7 @@
from asf_search.constants import INTERNAL
from asf_search.WKT.validate_wkt import validate_wkt
from asf_search.search.error_reporting import report_search_error

from typing import List # for 3.8 compatibility

def search_generator(
absoluteOrbit: Union[int, Tuple[int, int], Iterable[Union[int, Tuple[int, int]]]] = None,
Expand Down Expand Up @@ -131,7 +131,7 @@ def query_cmr(session: ASFSession, url: str, translated_opts: dict, sub_query_co
return items, hits, response.headers.get('CMR-Search-After', None)


def process_page(items: list[ASFProduct], max_results: int, subquery_max_results: int, total: int, subquery_count: int, opts: ASFSearchOptions):
def process_page(items: List[ASFProduct], max_results: int, subquery_max_results: int, total: int, subquery_count: int, opts: ASFSearchOptions):
if max_results is None:
last_page = ASFSearchResults(items[:min(subquery_max_results - subquery_count, len(items))], opts=opts)
else:
Expand Down

0 comments on commit 93a37a6

Please sign in to comment.