Skip to content

Commit

Permalink
refactor: move nonetype budget check further up the chain in the block
Browse files Browse the repository at this point in the history
  • Loading branch information
Osneil Drakes authored and Osneil Drakes committed Sep 10, 2024
1 parent 9d0a2f5 commit 4eab526
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gcf_data_mapper/parsers/family.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@ def map_family_metadata(row: pd.Series) -> Optional[dict]:
)
gcf_budgets = get_budgets(funding_sources, GCFProjectBudgetSource.GCF.value)

if gcf_budgets is None or co_financing_budgets is None:
return None

implementing_agencies = [entity[name_key] for entity in entities]
regions = [country[region_key] for country in countries]
areas = [result[area_key] for result in result_areas]
types = [result[type_key] for result in result_areas]

if gcf_budgets is None or co_financing_budgets is None:
return None

# As we are filtering the budget information by source for gcf and co financing, we
# know there will be instances where only one type of funding exists so checking
# for empty/false values would create false positives, hence the exclusion from this
Expand Down

0 comments on commit 4eab526

Please sign in to comment.