Skip to content

Commit

Permalink
Use tiledb-py dep; typing
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenv committed Sep 11, 2023
1 parent bd39432 commit 6efcd85
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions apis/python/src/tiledbsoma/_arrow_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import pandas as pd
import pyarrow as pa
import tiledb
from pandas.api.types import is_categorical_dtype

_ARROW_TO_TDB_ATTR: Dict[Any, Union[str, TypeError]] = {
pa.string(): "U1",
Expand Down Expand Up @@ -192,7 +191,8 @@ def df_to_arrow(df: pd.DataFrame) -> pa.Table:
# So, we cast and reconstruct.
for key in df:
column = df[key]
if is_categorical_dtype(column.dtype):

if isinstance(column.dtype, pd.CategoricalDtype):
if hasattr(column.values, "categories"):
categories = column.values.categories

Expand Down
4 changes: 2 additions & 2 deletions apis/python/src/tiledbsoma/_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,9 +690,9 @@ def _build_tiledb_schema(
schema: pa.Schema,
index_column_names: Sequence[str],
domain: Optional[Sequence[Optional[Tuple[Any, Any]]]],
enumerations: dict[str, Any],
enumerations: Dict[str, Any],
ordered_enumerations: Sequence[str],
column_to_enumerations: dict[str, str],
column_to_enumerations: Dict[str, str],
tiledb_create_options: TileDBCreateOptions,
context: SOMATileDBContext,
) -> tiledb.ArraySchema:
Expand Down

0 comments on commit 6efcd85

Please sign in to comment.