Skip to content

Commit 8e09bd7

Browse files
committed
Ignore ButterProduction without any kcals - see HEA-887
There are sometimes 0 values in the combined percentage_kcals fields for Season 2 but no MilkProduction production for that Season. This commit ignores the 0 values so they don't trigger a move of those kcals from ButterProduction to MilkProduction.
1 parent bd6e797 commit 8e09bd7

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

pipelines/assets/livelihood_activity.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,10 @@ def get_instances_from_dataframe(
902902
if (
903903
livelihood_strategy["strategy_type"] == "ButterProduction"
904904
and "percentage_kcals" in livelihood_strategy["attribute_rows"]
905+
and any(
906+
livelihood_activity.get("percentage_kcals")
907+
for livelihood_activity in livelihood_activities_for_strategy
908+
)
905909
):
906910
# Find the MilkProduction livelihood strategy
907911
milk_strategy = None

0 commit comments

Comments
 (0)