From ad62c43db89bdb567a55c0bd89f8b7ad7ff47855 Mon Sep 17 00:00:00 2001 From: Julia Dark Date: Fri, 9 Aug 2024 10:58:39 -0400 Subject: [PATCH] Fix typo where `var` should be checked instead of `obs` --- python-spec/src/somacore/query/query.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-spec/src/somacore/query/query.py b/python-spec/src/somacore/query/query.py index bd4a7410..7883fc81 100644 --- a/python-spec/src/somacore/query/query.py +++ b/python-spec/src/somacore/query/query.py @@ -320,7 +320,7 @@ def to_anndata( if isinstance(ad.obs[name], pd.CategoricalDtype): ad.obs[name] = ad.obs[name].cat.remove_unused_categories() for name in ad.var: - if isinstance(ad.obs[name], pd.CategoricalDtype): + if isinstance(ad.var[name], pd.CategoricalDtype): ad.var[name] = ad.var[name].cat.remove_unused_categories() return ad