Skip to content

FsspecStore.from_mapper() fails with DefaultAzureCredential because AzureBlobFileSystem is not JSON serializable #4220

Closed

Description

@hginzel

Zarr version

v3.3.0

Numcodecs version

v0.6.15

Python Version

3.12.11

Operating System

Ubuntu 26.04

Installation

uv add zarr

Environment

  • Python 3.12.11
  • zarr 3.3.0
  • xarray 2026.7.0
  • fsspec 2026.7.0
  • adlfs 2026.5.0
  • azure-identity 1.25.3

Description

Opening an xarray dataset backed by an Azure Blob Storage FSMap created with
DefaultAzureCredential fails because FsspecStore.from_mapper() attempts to
serialize the filesystem using fs.to_json().

The embedded DefaultAzureCredential is not JSON serializable.

Steps to reproduce

# /// script
# requires-python = ">=3.12"
# dependencies = [
#   "zarr@git+https://github.com/zarr-developers/zarr-python.git@main",
# ]
# ///
#
# This script automatically imports the development branch of zarr to check for issues

import zarr
from fsspec import filesystem
from azure.identity import DefaultAzureCredential
import xarray as xr

fs = filesystem(
    "az",
    account_name="<account>",
    credential=DefaultAzureCredential(),
)
mapper = fs.get_mapper("container/example.zarr")
xr.open_zarr(mapper)

# zarr.print_debug_info()

Additional output

Traceback

TypeError: Object of type DefaultAzureCredential is not JSON serializable

The traceback ends in
FsspecStore.from_mapper(...)
_make_async(...)
fs.to_json()
json.dumps(...)

Activity

  1. added
    bugPotential issues with the zarr-python library
    on Jul 30, 2026
  2. d-v-b commented on Jul 30, 2026

    @d-v-b
    Contributor

    thanks for the report, did this start breaking in the recent 3.3.0 release?

  3. hginzel commented on Jul 30, 2026

    @hginzel
    Author

    Sorry, don't know, no tested before.

  4. added a commit that references this issue on Aug 5, 2026
    4e13cf5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugPotential issues with the zarr-python library

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions