Add hd_score_g2 support to Rules block
All checks were successful
Build and Push Docker Image / test (push) Successful in 11s
Build and Push Docker Image / build_and_push (push) Successful in 3m18s

This commit is contained in:
Ankur Malik 2025-11-26 11:55:08 -05:00
parent 2cf9a2e5f9
commit 7aa04da902
5 changed files with 13 additions and 2 deletions

View File

@ -16,7 +16,8 @@ def __main__(
email_cnt: int,
rejected_app_count: float,
app_dt_day_cnt: int,
hd_score_iso_m2: float
hd_score_iso_m2: float,
hd_score_g2: float
) -> dict:
# Create a dictionary instead of using pandas DataFrame
data = {
@ -28,6 +29,7 @@ def __main__(
"rejected_app_count": rejected_app_count,
"app_dt_day_cnt": app_dt_day_cnt,
"hd_score_iso_m2": hd_score_iso_m2,
"hd_score_g2": hd_score_g2
}
final = processing(data)

View File

@ -10,6 +10,10 @@
"type": ["number", "null"],
"description": "HD Fraud Score G1"
},
"hd_score_g2": {
"type": ["number", "null"],
"description": "HD Fraud Score G1"
},
"cluster_size_users_v2": {
"type": ["number", "null"],
"description": "Size of the user cluster in version 2."

View File

@ -10,6 +10,10 @@
"type": ["number", "null"],
"description": "HD Fraud Score G1"
},
"hd_score_g2": {
"type": ["number", "null"],
"description": "HD Fraud Score G1"
},
"hd_score_s1": {
"type": ["number", "null"],
"description": "HD Fraud Score S1"

View File

@ -50,6 +50,7 @@ def processing(data: dict) -> dict:
"hd_score_s2": hd_score_s2,
"hd_score_s3": hd_score_s3,
"hd_score_iso_m2": data["hd_score_iso_m2"],
"hd_score_g2": data["hd_score_g2"]
}

View File

@ -1,7 +1,7 @@
import unittest
from block import __main__
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}
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, "hd_score_g2": 0.0}
class TestBlock(unittest.TestCase):
def test_main_success(self):