Skip to content

Commit

Permalink
enhance: exclude income groups for now
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelgerber committed Feb 6, 2025
1 parent b40b6f8 commit 9da9b44
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions devTools/regionsUpdater/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ const ETL_REGIONS_URL =
MKD: ["Macedonia"],
SWZ: ["Swaziland"],
USA: ["US", "USA"],
}
},
// we want to exclude income groups for now, until we can properly display the user's
// income group in the UI
REGIONS_TO_EXCLUDE = ["OWID_HIC", "OWID_UMC", "OWID_LMC", "OWID_LIC"]

interface Entity {
code: string
Expand Down Expand Up @@ -203,8 +206,10 @@ async function main() {
transform: csvToJson,
})

// strip out empty rows and make sure entities are sorted
data = _.sortBy(data, "code").filter((c: any) => !!c.code)
// strip out empty and excluded rows and make sure entities are sorted
data = _.sortBy(data, "code")
.filter((c: any) => !!c.code)
.filter((c: any) => !REGIONS_TO_EXCLUDE.includes(c.code))

const entities = _.map(data as Entity[], (entity) => {
// drop redundant attrs
Expand Down

0 comments on commit 9da9b44

Please sign in to comment.