Skip to content

Commit

Permalink
use iloc
Browse files Browse the repository at this point in the history
  • Loading branch information
melonora committed Mar 17, 2024
1 parent 4166360 commit 7bfa804
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/spatialdata/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ def _validate_table_annotation_metadata(self, data: AnnData) -> None:
if attr[self.INSTANCE_KEY] not in data.obs:
raise ValueError(f"`{attr[self.INSTANCE_KEY]}` not found in `adata.obs`.")
if (dtype := data.obs[attr[self.INSTANCE_KEY]].dtype) not in [np.int16, np.int32, np.int64, "O"] or (
dtype == "O" and (val_dtype := type(data.obs[attr[self.INSTANCE_KEY]][0])) != str
dtype == "O" and (val_dtype := type(data.obs[attr[self.INSTANCE_KEY]].iloc[0])) != str
):
dtype = dtype if dtype != "O" else val_dtype
raise TypeError(
Expand Down

0 comments on commit 7bfa804

Please sign in to comment.