Skip to content

Commit 5610e5f

Browse files
committed
Fix type
1 parent fd64379 commit 5610e5f

File tree

1 file changed

+5
-2
lines changed
  • services/common/rs_server_common/utils

1 file changed

+5
-2
lines changed

services/common/rs_server_common/utils/utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,13 +252,16 @@ def _apply_product_facets(feature: dict, _odata: dict) -> None:
252252
with PTYPE_MAPPING_FILE.open("r", encoding="utf-8") as f:
253253
product_type_data = yaml.safe_load(f)["types"]
254254

255-
props = feature["properties"]
255+
props: dict[str, str] = feature["properties"]
256256
if not (
257257
all(k in props for k in ("product:type", "processing:level"))
258258
and any(k in props for k in ("sar:instrument_mode", "eopf:instrument_mode", "instrument_mode"))
259259
):
260260
return
261-
legacy_type = next((item for item in product_type_data if item.get("legacyType") == props["product:type"]), None)
261+
legacy_type: dict[str, str] = next(
262+
(item for item in product_type_data if item.get("legacyType") == props["product:type"]),
263+
{},
264+
)
262265
props["product:type"] = legacy_type["productType"]
263266
props["processing:level"] = legacy_type["processingLevel"]
264267

0 commit comments

Comments
 (0)