Merged in hotfix/irs_tweak (pull request #303)
returning None instead on str(N/A) * returning None instead on str(N/A) Approved-by: Katon Minhas
This commit is contained in:
committed by
Katon Minhas
parent
56e3fdd1f8
commit
2458f8cddc
@@ -72,10 +72,10 @@ def clean_output_postprocess(merged_df):
|
||||
merged_df['dummy_other'] = merged_df['dummy_other'].apply(lambda lst: [x for x in [remove_alphabets(x) for x in lst] if x is not None])
|
||||
merged_df['dummy_other_signatory'] = merged_df['dummy_other_signatory'].apply(lambda lst: [x for x in [remove_alphabets(x) for x in lst] if x is not None])
|
||||
|
||||
merged_df['dummy'] = merged_df['dummy'].apply(lambda lst: [add_hyphen_if_needed(x) for x in lst])
|
||||
merged_df['dummy_other'] = merged_df['dummy_other'].apply(lambda lst: [add_hyphen_if_needed(x) for x in lst])
|
||||
merged_df['dummy_other_signatory'] = merged_df['dummy_other_signatory'].apply(lambda lst: [add_hyphen_if_needed(x) for x in lst])
|
||||
|
||||
merged_df['dummy'] = merged_df['dummy'].apply(lambda lst: [x for x in [add_hyphen_if_needed(x) for x in lst] if x is not None])
|
||||
merged_df['dummy_other'] = merged_df['dummy_other'].apply(lambda lst: [x for x in [add_hyphen_if_needed(x) for x in lst] if x is not None])
|
||||
merged_df['dummy_other_signatory'] = merged_df['dummy_other_signatory'].apply(lambda lst: [x for x in [add_hyphen_if_needed(x) for x in lst] if x is not None])
|
||||
|
||||
merged_df['dummy'] = merged_df['dummy'].apply(list_to_string)
|
||||
merged_df['dummy_other'] = merged_df['dummy_other'].apply(list_to_string)
|
||||
merged_df['dummy_other_signatory'] = merged_df['dummy_other_signatory'].apply(list_to_string)
|
||||
|
||||
@@ -352,6 +352,6 @@ def add_hyphen_if_needed(input_str):
|
||||
|
||||
# Ensure the output is in the format 'xx-xxxxxxx'
|
||||
if not bool(re.fullmatch(r"\b\d{2}-\d{7}\b", input_str)):
|
||||
input_str = 'N/A'
|
||||
input_str = None
|
||||
|
||||
return input_str
|
||||
Reference in New Issue
Block a user