Skip to content

Commit c6cb19a

Browse files
authored
Merge pull request #170 from FEWS-NET/HEA-747/TypeError_unsupported_operand_type(s)_'NoneType'_and_'int'
Add check for None to the livelihood_activity["kcals_consumed"]
2 parents 0e8206c + 39751bc commit c6cb19a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pipelines/assets/livelihood_activity.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,9 @@ def get_instances_from_dataframe(
612612
) or livelihood_activity.get("people_per_household", None)
613613
livelihood_activity["times_per_year"] = (
614614
round(livelihood_activity["kcals_consumed"] / kcals_per_unit / number_of_units)
615-
if number_of_units and kcals_per_unit
615+
if number_of_units
616+
and kcals_per_unit
617+
and livelihood_activity["kcals_consumed"] is not None
616618
else 0
617619
)
618620

0 commit comments

Comments
 (0)