Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: the metadata keys should be singular not plural #19

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading