Skip to content

Commit

Permalink
added Background to description; fix for alias_name etl (#1383)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhuseinov authored Feb 5, 2024
1 parent d25b2ca commit fd3596b
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,13 @@ def _map_data(row, insert_index):


def _get_organization_name(row):
return (
f"{row.get('organization_name','')} {row.get('alias_name', '')}".strip() or None
)
organization_name = (row.get("organization_name") or "").strip()
alias_name = (row.get("alias_name") or "").strip()

if not organization_name and not alias_name:
return None

return f"{organization_name} {alias_name}".strip()

def _get_name(row):
first_name = row.get("first_name", None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,13 @@ def _map_data(row):
}

def _get_organization_name(row):
return (
f"{row.get('organization_name','')} {row.get('alias_name', '')}".strip() or None
)
organization_name = (row.get("organization_name") or "").strip()
alias_name = (row.get("alias_name") or "").strip()

if not organization_name and not alias_name:
return None

return f"{organization_name} {alias_name}".strip()


def _get_name(row):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def _map_fields(data):
if not summary and (not background_description or len(background_description) < 11):
data["purpose"] = NO_DATA_IN_OATS
else:
data["purpose"] = f"{summary} {background_description}"
data["purpose"] = f"{summary} . Background: {background_description}"

data["soil_is_follow_up"] = data["ministry_notice_ref_no"] != None
data["soil_has_submitted_notice"] = data["followup_noi_number"] != None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,13 @@ def _map_data(row, insert_index):


def _get_organization_name(row):
return (
f"{row.get('organization_name','')} {row.get('alias_name', '')}".strip() or None
)
organization_name = (row.get("organization_name") or "").strip()
alias_name = (row.get("alias_name") or "").strip()

if not organization_name and not alias_name:
return None

return f"{organization_name} {alias_name}".strip()


def _get_name(row):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,13 @@ def _map_data(row):


def _get_organization_name(row):
return (
f"{row.get('organization_name','')} {row.get('alias_name', '')}".strip() or None
)
organization_name = (row.get("organization_name") or "").strip()
alias_name = (row.get("alias_name") or "").strip()

if not organization_name and not alias_name:
return None

return f"{organization_name} {alias_name}".strip()


def _get_name(row):
Expand Down

0 comments on commit fd3596b

Please sign in to comment.