Skip to content

Commit d603a47

Browse files
committed
Raise if assumptions are not met
1 parent eca641e commit d603a47

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

tiled/adapters/zarr.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@ async def patch(
213213
new_shape[i] = max(new_shape[i], s)
214214
elif isinstance(s, builtins.slice) and isinstance(s.stop, int):
215215
new_shape[i] = max(new_shape[i], s.stop)
216+
else:
217+
raise TypeError(f"Unexpected slice parameter: {slice}")
216218
new_shape_tuple = tuple(new_shape)
217219
if new_shape_tuple != current_shape:
218220
if extend:

tiled/catalog/adapter.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,6 +1048,8 @@ async def patch(self, *args, **kwargs):
10481048
(await self.get_adapter()).patch, *args, **kwargs
10491049
)
10501050
node = await db.get(orm.Node, self.node.id)
1051+
if len(node.data_sources) != 1:
1052+
raise NotImplementedError("Only handles one data source")
10511053
data_source = node.data_sources[0]
10521054
structure_row = await db.get(orm.Structure, data_source.structure_id)
10531055
# Get the current structure row, update the shape, and write it back

0 commit comments

Comments
 (0)