Skip to content

Commit

Permalink
add leading zero to pid, tweak mapping for first_name (#1491)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhuseinov authored Mar 11, 2024
1 parent aab36e6 commit 56e3399
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def _map_data(row, insert_index):
"legal_description": row["legal_description"],
"map_area_hectares": row["area_size"],
"ownership_type_code": _map_ownership_type_code(row),
"pid": row["pid"],
"pid": str(row["pid"]).zfill(9) if row["pid"] is not None else None,
"pin": row["pin"],
"oats_subject_property_id": row["subject_property_id"],
"oats_property_id": row["property_id"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ def _get_name(row):
first_name = row.get("first_name", None)
middle_name = row.get("middle_name", None)

return " ".join(
result = " ".join(
[name for name in (first_name, middle_name) if name is not None]
).strip()

return None if result == "" else result
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,12 @@ def _get_name(row):
first_name = row.get("first_name", None)
middle_name = row.get("middle_name", None)

return " ".join(
result = " ".join(
[name for name in (first_name, middle_name) if name is not None]
).strip()

return None if result == "" else result


def _map_owner_type(data):
if data["organization_id"]:
Expand Down

0 comments on commit 56e3399

Please sign in to comment.