Skip to content

Commit 1177234

Browse files
committed
Fix missing payment_per_time attribute - see HEA-572
The BSSs often use labels that match to `price` for `PaymentInKind` or `OtherCashIncome` activities, rather than explicit labels that match `payment_per_time`. Therefore, we correct misidentified labels for these Strategy Types.
1 parent fab390e commit 1177234

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pipelines/assets/livelihood_activity.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,15 @@ def get_instances_from_dataframe(
853853
)
854854
activity_attribute = None
855855

856+
# For Payment In Kind and Other Cash Income the attribute for payment_per_time sometimes uses a label
857+
# that normally matches the price attribute.
858+
if activity_attribute == "price":
859+
if livelihood_strategy["strategy_type"] in (
860+
LivelihoodStrategyType.PAYMENT_IN_KIND,
861+
LivelihoodStrategyType.OTHER_CASH_INCOME,
862+
):
863+
activity_attribute = "payment_per_time"
864+
856865
# Some BSS incorrectly specify the product in the value columns instead of in the label column
857866
# Therefore, if we have specified the product__name as the attribute, check that the product
858867
# can be identified and is the same for all columns and then add it to the Livelihood Strategy.

0 commit comments

Comments
 (0)