Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct category dtype check in ExperimentAxisQuery #209

Merged
merged 1 commit into from
Aug 10, 2024

Conversation

nguyenv
Copy link
Member

@nguyenv nguyenv commented Aug 9, 2024

ad.{obs,var}[name] is always type pd.Series. We need to use .dtype to check the type of the column.

The original code used pd.api.types.is_categorical_dtype but that function is now deprecated.


(soma-3.11) vivian@mangonada:~/SOMA$ git log -1 --oneline
5ca6d91 (HEAD -> vn/correct-category-check, origin/vn/correct-category-check) Correct category dtype check in `ExperimentAxisQuery`

(soma-3.11) vivian@mangonada:~/TileDB-SOMA$ pip show somacore
Name: somacore
Version: 1.0.14.dev1+g402b2bc.d20240809
Summary: Python-language API specification and base utilities for implementation of the SOMA system.
Home-page:
Author:
Author-email:
License:
Location: /home/vivian/anaconda3/envs/soma-3.11/lib/python3.11/site-packages
Requires: anndata, attrs, numba, numpy, pandas, pyarrow, pyarrow-hotfix, scipy, typing-extensions
Required-by:

(soma-3.11) vivian@mangonada:~/TileDB-SOMA$ pytest apis/python/tests/ -k test_empty_categor
ical_query
=================================== test session starts ===================================
platform linux -- Python 3.11.0, pytest-8.0.1, pluggy-1.4.0
rootdir: /home/vivian/TileDB-SOMA/apis/python
plugins: cov-5.0.0, typeguard-4.2.1, hypothesis-6.98.9
collected 1766 items / 1765 deselected / 1 selected

apis/python/tests/test_experiment_query.py .                                        [100%]

@nguyenv nguyenv requested review from johnkerl and jp-dark August 9, 2024 18:27
Copy link
Member

@johnkerl johnkerl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@johnkerl
Copy link
Member

johnkerl commented Aug 9, 2024

I defer to @jp-dark though to double-check in sandbox

Copy link
Collaborator

@jp-dark jp-dark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@nguyenv nguyenv merged commit 569c196 into main Aug 10, 2024
7 checks passed
@nguyenv nguyenv deleted the vn/correct-category-check branch August 10, 2024 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants