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

[Backport release-1.7] [python] Silence a unit-test warning #2070

Merged
merged 1 commit into from
Jan 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions apis/python/src/tiledbsoma/io/conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import pandas as pd
import pandas._typing as pdt
import scipy.sparse as sp
from pandas.api.types import is_categorical_dtype

from .._funcs import typeguard_ignore
from .._types import NPNDArray, PDSeries
Expand Down Expand Up @@ -46,7 +45,9 @@ def to_tiledb_supported_array_type(name: str, x: _MT) -> _MT:
"""Converts datatypes unrepresentable by TileDB into datatypes it can represent.
E.g., float16 -> float32
"""
if isinstance(x, (np.ndarray, sp.spmatrix)) or not is_categorical_dtype(x):
if isinstance(x, (np.ndarray, sp.spmatrix)) or not isinstance(
x, pd.CategoricalDtype
):
# mypy issues a spurious error here, but only when
# _to_tiledb_supported_dtype is decorated with @typeguard_ignore???
target_dtype = _to_tiledb_supported_dtype(x.dtype) # type: ignore[arg-type]
Expand Down
Loading