Skip to content

Commit b2817ea

Browse files
committed
fix tests; fix typing for coloring column
1 parent 5200e02 commit b2817ea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/spatialdata_plot/pl/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ def _set_color_source_vec(
853853
color_source_vector = pd.Categorical(color_source_vector) # convert, e.g., `pd.Series`
854854

855855
color_mapping = _get_categorical_color_mapping(
856-
adata=sdata[table_name],
856+
adata=sdata.get(table_name, None),
857857
cluster_key=value_to_plot,
858858
color_source_vector=color_source_vector,
859859
cmap_params=cmap_params,
@@ -946,7 +946,7 @@ def _map_color_seg(
946946

947947

948948
def _generate_base_categorial_color_mapping(
949-
adata: AnnData,
949+
adata: AnnData | None,
950950
cluster_key: str,
951951
color_source_vector: ArrayLike | pd.Series[CategoricalDtype],
952952
na_color: Color,
@@ -1020,7 +1020,7 @@ def _get_default_categorial_color_mapping(
10201020

10211021

10221022
def _get_categorical_color_mapping(
1023-
adata: AnnData,
1023+
adata: AnnData | None,
10241024
na_color: Color,
10251025
cluster_key: str | None = None,
10261026
color_source_vector: ArrayLike | pd.Series[CategoricalDtype] | None = None,

0 commit comments

Comments
 (0)