correctly handle non-string categoricals (#1660)

This commit is contained in:
Bruce Martin
2020-07-22 12:14:31 -07:00
committed by GitHub
parent 009fa2ff02
commit a44da11f3f

View File

@@ -68,7 +68,7 @@ export function _normalizeCategoricalSchema(colSchema, col) {
const { type, writable } = colSchema;
if (type === "string" || type === "boolean" || type === "categorical") {
const categorySet = new Set(
col.summarize().categories.concat(colSchema.categories ?? [])
col.summarizeCategorical().categories.concat(colSchema.categories ?? [])
);
if (writable && !categorySet.has(unassignedCategoryLabel)) {
categorySet.add(unassignedCategoryLabel);