Skip to content

Commit 639e8d4

Browse files
authored
Remove unnecessary obstore import (#599)
1 parent 46aeaea commit 639e8d4

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

virtualizarr/manifests/store.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,6 @@ async def get(
295295
byte_range: ByteRequest | None = None,
296296
) -> Buffer | None:
297297
# docstring inherited
298-
import obstore as obs
299-
300298
if key.endswith("zarr.json"):
301299
return get_zarr_metadata(self._group, key)
302300
var = key.split("/")[0]
@@ -309,19 +307,19 @@ async def get(
309307
path = manifest._paths[*chunk_indexes]
310308
offset = manifest._offsets[*chunk_indexes]
311309
length = manifest._lengths[*chunk_indexes]
312-
# Get the configured object store instance that matches the path
313-
store = self._store_registry.get_store(path)
310+
314311
# Truncate path to match Obstore expectations
315312
key = urlparse(path).path
316313
# Transform the input byte range to account for the chunk location in the file
317314
chunk_end_exclusive = offset + length
318315
byte_range = _transform_byte_range(
319316
byte_range, chunk_start=offset, chunk_end_exclusive=chunk_end_exclusive
320317
)
318+
# Get the configured object store instance that matches the path
319+
store = self._store_registry.get_store(path)
321320
# Actually get the bytes
322321
try:
323-
bytes = await obs.get_range_async(
324-
store,
322+
bytes = await store.get_range_async(
325323
key,
326324
start=byte_range.start,
327325
end=byte_range.end,

0 commit comments

Comments
 (0)