Skip to content

Commit

Permalink
fix: the metadata keys should be singular not plural (#19)
Browse files Browse the repository at this point in the history
* fix: the metadata keys should be singular not plural

* Bump version to 0.1.13

---------

Co-authored-by: Osneil Drakes <[email protected]>
  • Loading branch information
odrakes-cpr and Osneil Drakes authored Sep 12, 2024
1 parent 81f6f3f commit cb2bcd4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions gcf_data_mapper/parsers/family.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,14 @@ def map_family_metadata(row: pd.Series) -> Optional[dict]:

metadata = {
"approved_ref": [row.at[FamilyColumnsNames.APPROVED_REF.value]],
"implementing_agencies": list(set(implementing_agencies)),
"implementing_agency": list(set(implementing_agencies)),
"project_id": [row.at[FamilyColumnsNames.PROJECTS_ID.value]],
"project_url": [row.at[FamilyColumnsNames.PROJECT_URL.value]],
"project_value_fund_spend": gcf_budgets,
"project_value_co_financing": co_financing_budgets,
"regions": list(set(regions)),
"result_areas": list(set(areas)),
"result_types": list(set(types)),
"region": list(set(regions)),
"result_area": list(set(areas)),
"result_type": list(set(types)),
"sector": [row.at[FamilyColumnsNames.SECTOR.value]],
"status": [status],
"theme": [row.at[FamilyColumnsNames.THEME.value]],
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "gcf-data-mapper"
version = "0.1.12"
version = "0.1.13"
description = "A CLI tool to wrangle GCF data into format recognised by the bulk-import tool."
authors = ["CPR-dev-team <[email protected]>"]
license = "Apache-2.0"
Expand Down
8 changes: 4 additions & 4 deletions tests/unit_tests/parsers/family/test_map_family.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ def parsed_family_data():
"import_id": "GCF.family.FP003.12660",
"metadata": {
"approved_ref": ["FP003"],
"implementing_agencies": ["Green Innovations"],
"implementing_agency": ["Green Innovations"],
"project_id": [12660],
"project_url": ["https://www.climateaction.fund/project/FP003"],
"project_value_fund_spend": [9200000],
"project_value_co_financing": [620000],
"regions": ["Asia"],
"result_areas": ["Coastal protection and restoration"],
"result_types": ["Adaptation"],
"region": ["Asia"],
"result_area": ["Coastal protection and restoration"],
"result_type": ["Adaptation"],
"sector": ["Environment"],
"status": ["Under Implementation"],
"theme": ["Adaptation"],
Expand Down
8 changes: 4 additions & 4 deletions tests/unit_tests/parsers/family/test_map_family_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
def parsed_family_metadata():
return {
"approved_ref": ["FP004"],
"implementing_agencies": ["Climate Action Innovations"],
"implementing_agency": ["Climate Action Innovations"],
"project_id": [1],
"project_url": ["https://www.climateaction.fund/project/FP004"],
"project_value_co_financing": [620000],
"project_value_fund_spend": [82000],
"regions": ["Latin America and the Caribbean"],
"result_areas": ["The Area for the Result Area"],
"result_types": ["The Type for the Result Area"],
"region": ["Latin America and the Caribbean"],
"result_area": ["The Area for the Result Area"],
"result_type": ["The Type for the Result Area"],
"sector": ["Private"],
"status": ["Under Implementation"],
"theme": ["Adaptation"],
Expand Down

0 comments on commit cb2bcd4

Please sign in to comment.