@@ -9,9 +9,10 @@ class IdentityMapInput:
99
1010 def __init__ (self , identity_type , emails_or_phones , already_hashed ):
1111 self .hashed_dii_to_raw_diis = {}
12- self .hashed_normalized_emails = []
13- self .hashed_normalized_phones = []
12+ self .hashed_normalized_emails = None
13+ self .hashed_normalized_phones = None
1414 if identity_type == IdentityType .Email :
15+ self .hashed_normalized_emails = []
1516 for email in emails_or_phones :
1617 if already_hashed :
1718 self .hashed_normalized_emails .append (email )
@@ -20,6 +21,7 @@ def __init__(self, identity_type, emails_or_phones, already_hashed):
2021 self ._add_hashed_to_raw_dii_mapping (hashed_normalized_email , email )
2122 self .hashed_normalized_emails .append (hashed_normalized_email )
2223 else : # phone
24+ self .hashed_normalized_phones = []
2325 for phone in emails_or_phones :
2426 if already_hashed :
2527 self .hashed_normalized_phones .append (phone )
@@ -58,4 +60,4 @@ def get_identity_map_input_as_json_string(self):
5860 "email_hash" : self .hashed_normalized_emails ,
5961 "phone_hash" : self .hashed_normalized_phones
6062 }
61- return json .dumps ({k : v for k , v in json_object .items () if v is not None and len ( v ) > 0 })
63+ return json .dumps ({k : v for k , v in json_object .items () if v is not None })
0 commit comments