Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ ci:
skip: []
repos:
- repo: https://github.com/rbubley/mirrors-prettier
rev: v3.5.3
rev: v3.7.4
hooks:
- id: prettier
exclude: ^.github/workflows/test.yaml
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.15.0
rev: v1.19.1
hooks:
- id: mypy
additional_dependencies: [numpy, types-requests]
exclude: tests/|docs/
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.11
rev: v0.14.10
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
1 change: 1 addition & 0 deletions src/spatialdata/_core/query/relational_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,7 @@ def get_values(
assert obs[region_key].nunique() == 1
assert obs[instance_key].nunique() == len(matched_table)
else:
assert isinstance(element, AnnData)
matched_table = element
instance_key = matched_table.uns[TableModel.ATTRS_KEY][TableModel.INSTANCE_KEY]
region_key = matched_table.uns[TableModel.ATTRS_KEY][TableModel.REGION_KEY_KEY]
Expand Down
4 changes: 2 additions & 2 deletions src/spatialdata/_core/spatialdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ def _filter_tables(

assert element_names is not None
table = _filter_table_by_element_names(table, element_names)
if len(table) != 0:
if table is not None and len(table) != 0:
tables[table_name] = table
elif by == "elements":
from spatialdata._core.query.relational_query import (
Expand All @@ -711,7 +711,7 @@ def _filter_tables(

assert elements_dict is not None
table = _filter_table_by_elements(table, elements_dict=elements_dict)
if len(table) != 0:
if table is not None and len(table) != 0:
tables[table_name] = table
else:
tables = self.tables
Expand Down
2 changes: 1 addition & 1 deletion src/spatialdata/_io/io_zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def read_zarr(
# the following is the SpatialDataContainerFormat version
if "spatialdata_attrs" not in root_group.metadata.attributes:
# backward compatibility for pre-versioned SpatialData zarr stores
sdata_version = cast(Literal["0.1", "0.2"], "0.1")
sdata_version: Literal["0.1", "0.2"] = "0.1"
else:
sdata_version = root_group.metadata.attributes["spatialdata_attrs"]["version"]
if sdata_version == "0.1":
Expand Down
Loading