-
Notifications
You must be signed in to change notification settings - Fork 57
Description
Describe the bug
In BEAM we noticed that while uploading a property, if the new data had a blank postal code, the blank value would become 00000 during the mapping process.
Before mapping:
After mapping:
I looked into the code and found that it happened at this step:
Lines 96 to 101 in c0960f0
| if mapped_column_name in {"postal_code", "owner_postal_code"}: | |
| if "-" in str(column_value): | |
| postal = str(column_value).split("-")[0].zfill(5) | |
| ext = str(column_value).split("-")[1].zfill(4) | |
| column_value = postal + "-" + ext | |
| column_value = str(column_value).zfill(5) |
Looking at the code's history, this block used to check for a column value first before zero-filling it. The commit message for the change is "Added leading zeros to 0 zip; modified test to do explicit check."
It looks like if column_value: was removed just for testing, but accidentally left out in the final code. Does that sound right? Can we add if column_value back in here without issue? Or is it used for hashing?
Expected Behavior
When uploading a property with a blank postal code, the Postal Code column value will be blank.
Actual Behavior
When uploading a property with a blank postal code, the Postal Code column value is "00000".