Skip to content

Commit

Permalink
Merge pull request #221 from asfadmin/bugfix-3.8-compatibility
Browse files Browse the repository at this point in the history
BUGFIX: python V3.8 Unsupported Type Hinting
  • Loading branch information
SpicyGarlicAlbacoreRoll authored Aug 29, 2023
2 parents 6174cef + 345c30e commit 3a029fb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
-
-->
------
## [v6.6.3](https://github.com/asfadmin/Discovery-asf_search/compare/v6.6.2...v6.6.3)
### Fixed
- Fixes type hinting compatibility break introduced in v6.6.2 in `search_generator.py` for Python versions < v3.9

------
## [v6.6.2](https://github.com/asfadmin/Discovery-asf_search/compare/v6.6.1...v6.6.2)
### Added
Expand Down
5 changes: 2 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 @@ -20,7 +20,6 @@
from asf_search.WKT.validate_wkt import validate_wkt
from asf_search.search.error_reporting import report_search_error


def search_generator(
absoluteOrbit: Union[int, Tuple[int, int], Iterable[Union[int, Tuple[int, int]]]] = None,
asfFrame: Union[int, Tuple[int, int], Iterable[Union[int, Tuple[int, int]]]] = None,
Expand Down Expand Up @@ -131,7 +130,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 3a029fb

Please sign in to comment.