Skip to content
This repository was archived by the owner on Apr 26, 2026. It is now read-only.

Commit 6444c1d

Browse files
committed
fixed issue with normalizer causing it to add an extra key
1 parent f56c024 commit 6444c1d

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

Tool-03-Case-Number-Normalizer.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,16 @@ def fix_account_numbers(file_path):
2525
updated_count = 0
2626
updated_data = {}
2727

28-
# Iterate through the accounts and update both the keys and the ACCOUNT_NUMBER_
28+
# Iterate through the accounts and update both the keys and the CASE_NUMBER
2929
for index, (old_key, account) in enumerate(data.items(), start=1):
3030
# Generate the new key (e.g., ACCOUNT_NUMBER_1, ACCOUNT_NUMBER_2, etc.)
3131
new_key = f"ACCOUNT_NUMBER_{index}"
3232

33-
# Update the 'ACCOUNT_NUMBER_' field inside the account data
34-
account["ACCOUNT_NUMBER_"] = str(index)
33+
# Remove the 'ACCOUNT_NUMBER_' field if it exists
34+
if "ACCOUNT_NUMBER_" in account:
35+
del account["ACCOUNT_NUMBER_"]
3536

36-
# Update the 'CASE_NUMBER' field as well
37+
# Update the 'CASE_NUMBER' field
3738
if account["CASE_NUMBER"] != str(index): # If the CASE_NUMBER is incorrect
3839
updated_count += 1
3940
account["CASE_NUMBER"] = str(index)

0 commit comments

Comments
 (0)