Update Rules block processing and schemas
All checks were successful
Build and Push Docker Image / test (push) Successful in 1m1s
Build and Push Docker Image / build_and_push (push) Successful in 17s

This commit is contained in:
Ankur Malik 2025-11-23 23:39:01 -05:00
parent 54b5fecdb9
commit 2cf9a2e5f9
5 changed files with 12 additions and 1 deletions

View File

@ -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)

View File

@ -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": []

View File

@ -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"
}
}
}

View File

@ -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"],
}

View File

@ -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):