Update Rules block processing and schemas
This commit is contained in:
parent
54b5fecdb9
commit
2cf9a2e5f9
2
block.py
2
block.py
@ -16,6 +16,7 @@ def __main__(
|
||||
email_cnt: int,
|
||||
rejected_app_count: float,
|
||||
app_dt_day_cnt: int,
|
||||
hd_score_iso_m2: float
|
||||
) -> dict:
|
||||
# Create a dictionary instead of using pandas DataFrame
|
||||
data = {
|
||||
@ -26,6 +27,7 @@ def __main__(
|
||||
"email_cnt": email_cnt,
|
||||
"rejected_app_count": rejected_app_count,
|
||||
"app_dt_day_cnt": app_dt_day_cnt,
|
||||
"hd_score_iso_m2": hd_score_iso_m2,
|
||||
}
|
||||
|
||||
final = processing(data)
|
||||
|
||||
@ -29,6 +29,10 @@
|
||||
"app_dt_day_cnt": {
|
||||
"type": ["number", "null"],
|
||||
"description": "Number of application days counted."
|
||||
},
|
||||
"hd_score_iso_m2": {
|
||||
"type": ["number", "null"],
|
||||
"description": "HD fraud Score M2"
|
||||
}
|
||||
},
|
||||
"required": []
|
||||
|
||||
@ -21,6 +21,10 @@
|
||||
"hd_score_s3": {
|
||||
"type": ["number", "null"],
|
||||
"description": "HD Fraud Score S3"
|
||||
},
|
||||
"hd_score_iso_m2": {
|
||||
"type": ["number", "null"],
|
||||
"description": "HD Fraud Score M2"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -49,6 +49,7 @@ def processing(data: dict) -> dict:
|
||||
"hd_score_s1": hd_score_s1,
|
||||
"hd_score_s2": hd_score_s2,
|
||||
"hd_score_s3": hd_score_s3,
|
||||
"hd_score_iso_m2": data["hd_score_iso_m2"],
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import unittest
|
||||
from block import __main__
|
||||
|
||||
data = {'hd_score_m1': 1173.0, 'hd_score_g1': 1203.0, 'cluster_size_users_v2': 3.0, 'target_connected_30_sum': 0.0, 'email_cnt': 1.0, 'rejected_app_count': 2.0, 'app_dt_day_cnt': 3.0}
|
||||
data = {'hd_score_m1': 1093.0, 'hd_score_g1': 0.0, 'cluster_size_users_v2': 1.0, 'target_connected_30_sum': 0.0, 'email_cnt': 1.0, 'rejected_app_count': 0.0, 'app_dt_day_cnt': 1.0, 'hd_score_iso_m2': 1001.0}
|
||||
|
||||
class TestBlock(unittest.TestCase):
|
||||
def test_main_success(self):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user