mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-06 06:48:12 +08:00
correctly handle non-string categoricals (#1660)
This commit is contained in:
@@ -68,7 +68,7 @@ export function _normalizeCategoricalSchema(colSchema, col) {
|
|||||||
const { type, writable } = colSchema;
|
const { type, writable } = colSchema;
|
||||||
if (type === "string" || type === "boolean" || type === "categorical") {
|
if (type === "string" || type === "boolean" || type === "categorical") {
|
||||||
const categorySet = new Set(
|
const categorySet = new Set(
|
||||||
col.summarize().categories.concat(colSchema.categories ?? [])
|
col.summarizeCategorical().categories.concat(colSchema.categories ?? [])
|
||||||
);
|
);
|
||||||
if (writable && !categorySet.has(unassignedCategoryLabel)) {
|
if (writable && !categorySet.has(unassignedCategoryLabel)) {
|
||||||
categorySet.add(unassignedCategoryLabel);
|
categorySet.add(unassignedCategoryLabel);
|
||||||
|
|||||||
Reference in New Issue
Block a user