Skip to content

Commit

Permalink
fix ambiguous table vector None (scverse#508)
Browse files Browse the repository at this point in the history
  • Loading branch information
melonora authored Mar 25, 2024
1 parent 08297ad commit 270d81f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/spatialdata/_core/spatialdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def get_region_key_column(table: AnnData) -> pd.Series:
If the region key column is not found in table.obs.
"""
_, region_key, _ = get_table_keys(table)
if table.obs.get(region_key):
if table.obs.get(region_key) is not None:
return table.obs[region_key]
raise KeyError(f"{region_key} is set as region key column. However the column is not found in table.obs.")

Expand All @@ -311,7 +311,7 @@ def get_instance_key_column(table: AnnData) -> pd.Series:
"""
_, _, instance_key = get_table_keys(table)
if table.obs.get(instance_key):
if table.obs.get(instance_key) is not None:
return table.obs[instance_key]
raise KeyError(f"{instance_key} is set as instance key column. However the column is not found in table.obs.")

Expand Down

0 comments on commit 270d81f

Please sign in to comment.