From 1768b704a3fd3350156189646eaaef8669762db7 Mon Sep 17 00:00:00 2001 From: tcchase Date: Thu, 21 May 2026 12:47:36 -0400 Subject: [PATCH 1/4] feat: granule list supports other filters --- CHANGELOG.md | 5 +++++ src/SearchAPI/application/asf_opts.py | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96aed99..1a646a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,11 @@ and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - --> +----- +## [1.0.17](https://github.com/asfadmin/Discovery-SearchAPI-v3/compare/v1.0.15...v1.0.16) +### Changed +- Searches with `granule_list` can use other search filters + ------ ## [1.0.16](https://github.com/asfadmin/Discovery-SearchAPI-v3/compare/v1.0.15...v1.0.16) ### Changed diff --git a/src/SearchAPI/application/asf_opts.py b/src/SearchAPI/application/asf_opts.py index a19cc71..e0c92b9 100644 --- a/src/SearchAPI/application/asf_opts.py +++ b/src/SearchAPI/application/asf_opts.py @@ -295,10 +295,6 @@ def get_asf_opts(params: dict) -> asf.ASFSearchOptions: "Unbound wildcard searches not supported with SearchAPI." "Specify `maxresults` or use the asf-search python module directly (try `output=python` to download the equivalent script)" ) - if len([param for param in params if param not in ["collections", "maxResults"]]) > 1: - raise ValueError( - 'Cannot use search keywords "granule_list/product_list" with other search params' - ) if (flight_direction := params.get("flightDirection")) is not None: if isinstance(flight_direction, str) and len(flight_direction): From acf3a0a57c8f4e308a03eee21144bdb344126735 Mon Sep 17 00:00:00 2001 From: tcchase Date: Thu, 21 May 2026 13:52:55 -0400 Subject: [PATCH 2/4] fix: keep old behaviour for product_list --- src/SearchAPI/application/asf_opts.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/SearchAPI/application/asf_opts.py b/src/SearchAPI/application/asf_opts.py index e0c92b9..43e1c5a 100644 --- a/src/SearchAPI/application/asf_opts.py +++ b/src/SearchAPI/application/asf_opts.py @@ -295,6 +295,11 @@ def get_asf_opts(params: dict) -> asf.ASFSearchOptions: "Unbound wildcard searches not supported with SearchAPI." "Specify `maxresults` or use the asf-search python module directly (try `output=python` to download the equivalent script)" ) + if "product_list" in params: + if len([param for param in params if param not in ["collections", "maxResults"]]) > 1: + raise ValueError( + 'Cannot use search keywords "granule_list/product_list" with other search params' + ) if (flight_direction := params.get("flightDirection")) is not None: if isinstance(flight_direction, str) and len(flight_direction): From ef8f2b5b6f71eb4db8452a233f73c0288d1f520a Mon Sep 17 00:00:00 2001 From: tcchase Date: Thu, 21 May 2026 13:53:12 -0400 Subject: [PATCH 3/4] feat: update tests for new granule_list behavior --- tests/yml_tests/test_URLs.yml | 25 ++++++++++++++++++++++ tests/yml_tests/test_URLs_expected_400.yml | 23 -------------------- 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/tests/yml_tests/test_URLs.yml b/tests/yml_tests/test_URLs.yml index a33ccf7..b2c0f33 100644 --- a/tests/yml_tests/test_URLs.yml +++ b/tests/yml_tests/test_URLs.yml @@ -458,6 +458,31 @@ tests: expected file: x-python expected code: 200 +- granule_list with platform valid: + granule_list: S1B_S6_GRDH_1SDV_20190911T214309_20190911T214338_017995_021E10_5CCB + platform: S1 + output: json + + expected file: json + expected code: 200 + +- granule_list with date valid: + granule_list: S1B_S6_GRDH_1SDV_20190911T214309_20190911T214338_017995_021E10_5CCB + start: "2019-01-01T00:00:00Z" + output: json + + expected file: json + expected code: 200 + +- granule_list with other keywords valid: + intersectsWith: polygon((-91.1083+41.7191,-83.9568+41.4233,-83.9916+43.9781,-91.7194+42.8556,-91.1083+41.7191)) + platform: Sentinel-1A, Sentinel-1B + granule_list: S1A_IW_GRDH_1SDV_20220201T000545_20220201T000612_041712_04F694_C8B2 + output: json + + expected file: json + expected code: 200 + #In CMR reporting script, we report groupid as null on most datasets. Some datasets updated to expect blank file & moved to partial pass yaml - groupid Sentinel: groupid: S1B_S1DV_0492_0497_017567_041 diff --git a/tests/yml_tests/test_URLs_expected_400.yml b/tests/yml_tests/test_URLs_expected_400.yml index 02a7540..7437ee8 100644 --- a/tests/yml_tests/test_URLs_expected_400.yml +++ b/tests/yml_tests/test_URLs_expected_400.yml @@ -202,30 +202,7 @@ tests: expected file: error json expected code: 400 -- granule_list with platform invalid: - granule_list: S1B_S6_GRDH_1SDV_20190911T214309_20190911T214338_017995_021E10_5CCB - platform: S1 - output: csv - - expected file: error json - expected code: 400 - -- granule_list with date invalid: - granule_list: S1B_S6_GRDH_1SDV_20190911T214309_20190911T214338_017995_021E10_5CCB - start: "2019-01-01T00:00:00Z" - output: csv - - expected file: error json - expected code: 400 -- granule_list with other keywords invalid: - intersectsWith: polygon((-91.1083+41.7191,-83.9568+41.4233,-83.9916+43.9781,-91.7194+42.8556,-91.1083+41.7191)) - platform: Sentinel-1A,Sentinel-1B - granule_list: S1A_IW_GRDH_1SDV_20220201T000545_20220201T000612_041712_04F694_C8B2 - output: json - - expected file: error json - expected code: 400 - granule_list with product_list invalid: granule_list: S1B_S6_GRDH_1SDV_20190911T214309_20190911T214338_017995_021E10_5CCB From 87743a592fd3c6138a2fe5492bd0738a88e67d35 Mon Sep 17 00:00:00 2001 From: tcchase Date: Tue, 26 May 2026 15:48:23 -0400 Subject: [PATCH 4/4] chore: update product list error message --- src/SearchAPI/application/asf_opts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SearchAPI/application/asf_opts.py b/src/SearchAPI/application/asf_opts.py index 43e1c5a..245ef3d 100644 --- a/src/SearchAPI/application/asf_opts.py +++ b/src/SearchAPI/application/asf_opts.py @@ -298,7 +298,7 @@ def get_asf_opts(params: dict) -> asf.ASFSearchOptions: if "product_list" in params: if len([param for param in params if param not in ["collections", "maxResults"]]) > 1: raise ValueError( - 'Cannot use search keywords "granule_list/product_list" with other search params' + 'Cannot use search keyword "product_list" with other search params' ) if (flight_direction := params.get("flightDirection")) is not None: