Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(server): load processing level as string in external stac collection #1429

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion eodag/rest/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,11 +728,16 @@ def eodag_api_init() -> None:
constellation: Union[str, List[str]] = ext_col.get("summaries", {}).get(
"constellation"
)
processing_level: Union[str, List[str]] = ext_col.get("summaries", {}).get(
"processing:level"
)
# Check if platform or constellation are lists and join them into a string if they are
if isinstance(platform, list):
platform = ",".join(platform)
if isinstance(constellation, list):
constellation = ",".join(constellation)
if isinstance(processing_level, list):
processing_level = ",".join(processing_level)

update_fields = {
"title": ext_col.get("title"),
Expand All @@ -743,7 +748,7 @@ def eodag_api_init() -> None:
),
"platform": constellation,
"platformSerialIdentifier": platform,
"processingLevel": ext_col.get("summaries", {}).get("processing:level"),
"processingLevel": processing_level,
"license": ext_col["license"],
"missionStartDate": ext_col["extent"]["temporal"]["interval"][0][0],
"missionEndDate": ext_col["extent"]["temporal"]["interval"][-1][1],
Expand Down
Loading