diff --git a/CHANGELOG.md b/CHANGELOG.md index 61e6a683..d2e72a69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,12 @@ and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html). --> ------ -## [v.7.0.0](https://github.com/asfadmin/Discovery-asf_search/compare/v6.7.3...v.7.0.0) +## [v7.0.1](https://github.com/asfadmin/Discovery-asf_search/compare/v7.0.0...v7.0.1) +### Fixed +- Fixed `OPERA-S1-CALIBRATION` dataset products raising error during search. + +------ +## [v7.0.0](https://github.com/asfadmin/Discovery-asf_search/compare/v6.7.3...v7.0.0) ### Added - `ASFProduct` now has 13 sublcasses for different sub-products that correspond to datasets: - `S1Product`, `S1BurstProduct`, `OPERAS1Product`, `ARIAS1GUNWProduct`, `ALOSProduct`, `RADARSATProduct`, `AIRSARProduct`, `ERSProduct`, `JERSProduct`, `UAVSARProduct`, `SIRCProduct`, `SEASATProduct`, `SMAPProduct` diff --git a/asf_search/search/search_generator.py b/asf_search/search/search_generator.py index f437eee4..a2e9a397 100644 --- a/asf_search/search/search_generator.py +++ b/asf_search/search/search_generator.py @@ -250,13 +250,17 @@ def as_ASFProduct(item: Dict, session: ASFSession) -> ASFProduct: product_type_key = _get_product_type_key(item) # if there's a direct entry in our dataset to product type dict - if (subclass := dataset_to_product_types.get(product_type_key)) is not None: + subclass = dataset_to_product_types.get(product_type_key) + if subclass is not None: return subclass(item, session=session) # or if the key matches one of the shortnames in any of our datasets for dataset, collections in dataset_collections.items(): if collections.get(product_type_key) is not None: - return dataset_to_product_types.get(dataset)(item, session=session) + subclass = dataset_to_product_types.get(dataset) + if subclass is not None: + return subclass(item, session=session) + break # dataset exists, but is not in dataset_to_product_types yet return ASFProduct(item, session=session) @@ -283,6 +287,7 @@ def _get_product_type_key(item: Dict) -> str: dataset_to_product_types = { 'SENTINEL-1': ASFProductType.S1Product, 'OPERA-S1': ASFProductType.OPERAS1Product, + 'OPERA-S1-CALIBRATION': ASFProductType.OPERAS1Product, 'SLC-BURST': ASFProductType.S1BurstProduct, 'ALOS': ASFProductType.ALOSProduct,