From 93a37a601b48cb487385d6cadeec6880425e711d Mon Sep 17 00:00:00 2001 From: kim Date: Mon, 28 Aug 2023 15:11:35 -0800 Subject: [PATCH 1/4] fixes breaking change added to search_generator caused by list type hinting --- asf_search/search/search_generator.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/asf_search/search/search_generator.py b/asf_search/search/search_generator.py index 156e50d5..07322e5e 100644 --- a/asf_search/search/search_generator.py +++ b/asf_search/search/search_generator.py @@ -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 @@ -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, @@ -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: From fd4681745b11b91131dce27bcb42162bcb418d1b Mon Sep 17 00:00:00 2001 From: kim Date: Mon, 28 Aug 2023 15:17:03 -0800 Subject: [PATCH 2/4] update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 540279f5..aadce758 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 6.6.2 in `search_generator.py` + ------ ## [v6.6.2](https://github.com/asfadmin/Discovery-asf_search/compare/v6.6.1...v6.6.2) ### Added From 548d355a886a136e9fac2b9a65a57def245d5179 Mon Sep 17 00:00:00 2001 From: kim Date: Mon, 28 Aug 2023 15:29:43 -0800 Subject: [PATCH 3/4] removes redundant import line --- asf_search/search/search_generator.py | 1 - 1 file changed, 1 deletion(-) diff --git a/asf_search/search/search_generator.py b/asf_search/search/search_generator.py index 07322e5e..8763ea7e 100644 --- a/asf_search/search/search_generator.py +++ b/asf_search/search/search_generator.py @@ -19,7 +19,6 @@ 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, From 345c30e65a471f27a3b0f87c3a4778d6e8d56886 Mon Sep 17 00:00:00 2001 From: kim Date: Mon, 28 Aug 2023 15:37:30 -0800 Subject: [PATCH 4/4] update changelog message --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aadce758..bd48bd8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,7 +28,7 @@ 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 6.6.2 in `search_generator.py` +- 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)