Skip to content

Commit 15d7ccc

Browse files
committed
Fix score calculation for budget changes
1 parent 2fe468d commit 15d7ccc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

budgetkey_data_pipelines/pipelines/budget/national/changes/original/calc-transaction-score.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import math
22
import datetime
33
import logging
4+
from decimal import Decimal
5+
46
from datapackage_pipelines.wrapper import process
57

68

@@ -27,7 +29,7 @@ def process_row(row, *_):
2729
if amount is None:
2830
logging.warning('volume is None: %r', row)
2931
amount = 0
30-
amount /= divider
32+
amount /= Decimal(divider)
3133
sum += abs(amount)
3234
row['score'] = max(1, sum)
3335
return row

0 commit comments

Comments
 (0)