Skip to content

Azure blob storage prepends a '/' to the blob names when the prefix is None #525

Closed
@shikharsg

Description

@shikharsg

Azure blob storage prepends a '/' to the blob names, even when the prefix is None. Code sample:

Minimal, reproducible code sample

This code needs to connect to Azure Blob (the sample below connects to a local emulator)

>>> import zarr
>>> store = zarr.ABSStore('test', prefix=None, blob_service_kwargs={'is_emulated':True})
>>> g = zarr.open_group(store)
>>> ## list all blobs in the container
>>> print([blob.name for blob in store.client.list_blobs('test')])
['/.zgroup']

which shows up in the storage explorer like this:
image

There should ideally be no '/' before the .zgroup and it should look like this:

>>> import zarr
>>> store = zarr.ABSStore('test', prefix=None, blob_service_kwargs={'is_emulated':True})
>>> g = zarr.open_group(store)
>>> ## list all blobs in the container
>>> print([blob.name for blob in store.client.list_blobs('test')])
['.zgroup']

image

Will submit a PR for this in a bit

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions