Skip to content

Commit 683829b

Browse files
committed
More informative error message for missing sub-national seasons - see HEA-196
1 parent 2c66838 commit 683829b

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

pipelines/assets/livelihood_activity.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -458,12 +458,10 @@ def get_all_label_attributes(
458458
(all_label_attributes["season_original"] != "") & (all_label_attributes["season"].isna())
459459
]
460460
if not unrecognized_seasons_df.empty:
461-
raise ValueError(
462-
"Unrecognized seasons in labels:\n"
463-
+ unrecognized_seasons_df[
464-
["activity_label", "status", "strategy_type", "product_id", "season_original"]
465-
].to_markdown()
466-
)
461+
columns = ["activity_label", "status", "strategy_type", "product_id", "season_original", "country_id"]
462+
if livelihood_zone_id:
463+
columns.append("livelihood_zone_id")
464+
raise ValueError("Unrecognized seasons in labels:\n" + unrecognized_seasons_df[columns].to_markdown())
467465

468466
# Make sure we keep the same index so we can match by row number
469467
all_label_attributes.index = labels.index

0 commit comments

Comments
 (0)