Skip to content

Commit

Permalink
enhance(table): clearer transform description
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelgerber committed Apr 16, 2024
1 parent 0d63731 commit 5ecb333
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions packages/@ourworldindata/core-table/src/OwidTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
ColumnSlug,
imemo,
ToleranceStrategy,
differenceOfSets,
} from "@ourworldindata/utils"
import {
Integer,
Expand Down Expand Up @@ -312,15 +313,19 @@ export class OwidTable extends CoreTable<OwidRow, OwidColumnDef> {
}
}

// const entityNamesToDrop = differenceOfSets([
// this.availableEntityNameSet,
// entityNamesToKeep,
// ])
const entityNamesToDrop = differenceOfSets([
this.availableEntityNameSet,
entityNamesToKeep,
])
const droppedEntitiesStr =
entityNamesToDrop.size > 0
? [...entityNamesToDrop].join(", ")
: "(None)"

return this.columnFilter(
this.entityNameSlug,
(rowEntityName) => entityNamesToKeep.has(rowEntityName as string),
`Drop entities that have no data in some column: ${columnSlugs.join(", ")}`
`Drop entities that have no data in some column: ${columnSlugs.join(", ")}.\nDropped entities: ${droppedEntitiesStr}`
)
}

Expand Down

0 comments on commit 5ecb333

Please sign in to comment.