@@ -471,14 +471,14 @@ def maybe_decode_store(store, lock=False):
471471 store = filename_or_obj
472472
473473 if isinstance (filename_or_obj , MutableMapping ):
474- if engine == ' zarr' :
474+ if engine == " zarr" :
475475 # on ZarrStore, mode='r', synchronizer=None, group=None,
476476 # consolidated=False.
477- overwrite_encoded_chunks = backend_kwargs .pop ("overwrite_encoded_chunks" , None )
477+ overwrite_encoded_chunks = backend_kwargs .pop (
478+ "overwrite_encoded_chunks" , None
479+ )
478480 store = backends .ZarrStore .open_group (
479- filename_or_obj ,
480- group = group ,
481- ** backend_kwargs
481+ filename_or_obj , group = group , ** backend_kwargs
482482 )
483483
484484 elif isinstance (filename_or_obj , str ):
@@ -508,14 +508,14 @@ def maybe_decode_store(store, lock=False):
508508 store = backends .CfGribDataStore (
509509 filename_or_obj , lock = lock , ** backend_kwargs
510510 )
511- elif engine == ' zarr' :
511+ elif engine == " zarr" :
512512 # on ZarrStore, mode='r', synchronizer=None, group=None,
513513 # consolidated=False.
514- overwrite_encoded_chunks = backend_kwargs .pop ("overwrite_encoded_chunks" , None )
514+ overwrite_encoded_chunks = backend_kwargs .pop (
515+ "overwrite_encoded_chunks" , None
516+ )
515517 store = backends .ZarrStore .open_group (
516- filename_or_obj ,
517- group = group ,
518- ** backend_kwargs
518+ filename_or_obj , group = group , ** backend_kwargs
519519 )
520520 else :
521521 if engine not in [None , "scipy" , "h5netcdf" ]:
@@ -541,7 +541,8 @@ def maybe_decode_store(store, lock=False):
541541
542542 if chunks is not None :
543543 from dask .base import tokenize
544- if engine != 'zarr' :
544+
545+ if engine != "zarr" :
545546
546547 # if passed an actual file path, augment the token with
547548 # the file modification time
@@ -579,7 +580,10 @@ def maybe_decode_store(store, lock=False):
579580 if isinstance (chunks , int ):
580581 chunks = dict .fromkeys (ds .dims , chunks )
581582
582- variables = {k : backends .ZarrStore .open_group .maybe_chunk (k , v , chunks ) for k , v in ds .variables .items ()}
583+ variables = {
584+ k : store .maybe_chunk (k , v , chunks , overwrite_encoded_chunks )
585+ for k , v in ds .variables .items ()
586+ }
583587 ds2 = ds ._replace_vars_and_dims (variables )
584588 return ds2
585589 else :
0 commit comments