@@ -363,8 +363,6 @@ def create_store(self):
363
363
def roundtrip (
364
364
self , data , save_kwargs = None , open_kwargs = None , allow_cleanup_failure = False
365
365
):
366
- print (save_kwargs )
367
- print (open_kwargs )
368
366
if save_kwargs is None :
369
367
save_kwargs = {}
370
368
if open_kwargs is None :
@@ -912,9 +910,6 @@ def test_roundtrip_bytes_with_fill_value(self) -> None:
912
910
encoding = {"_FillValue" : b"X" , "dtype" : "S1" }
913
911
original = Dataset ({"x" : ("t" , values , {}, encoding )})
914
912
expected = original .copy (deep = True )
915
- zarr_format_3 = has_zarr_v3 and zarr .config .config ["default_zarr_format" ] == 3
916
- print (zarr_format_3 )
917
- print (self .version_kwargs )
918
913
with self .roundtrip (original ) as actual :
919
914
assert_identical (expected , actual )
920
915
@@ -2352,7 +2347,6 @@ def create_store(self, cache_members: bool = False):
2352
2347
)
2353
2348
2354
2349
def save (self , dataset , store_target , ** kwargs ): # type: ignore[override]
2355
- print ("ver kwargs" , self .version_kwargs )
2356
2350
return dataset .to_zarr (store = store_target , ** kwargs , ** self .version_kwargs )
2357
2351
2358
2352
@contextlib .contextmanager
@@ -2404,7 +2398,8 @@ def test_read_non_consolidated_warning(self) -> None:
2404
2398
2405
2399
def test_non_existent_store (self ) -> None :
2406
2400
with pytest .raises (
2407
- FileNotFoundError , match = "(No such file or directory|Unable to find group)"
2401
+ FileNotFoundError ,
2402
+ match = "(No such file or directory|Unable to find group|No group found in store)" ,
2408
2403
):
2409
2404
xr .open_zarr (f"{ uuid .uuid4 ()} " )
2410
2405
@@ -2486,6 +2481,7 @@ def test_manual_chunk(self) -> None:
2486
2481
assert_identical (actual .load (), auto .load ())
2487
2482
2488
2483
@requires_dask
2484
+ @pytest .mark .filterwarnings ("ignore:.*does not have a Zarr V3 specification.*" )
2489
2485
def test_warning_on_bad_chunks (self ) -> None :
2490
2486
original = create_test_data ().chunk ({"dim1" : 4 , "dim2" : 3 , "dim3" : 3 })
2491
2487
@@ -2894,7 +2890,6 @@ def test_append_with_existing_encoding_raises(self) -> None:
2894
2890
2895
2891
@pytest .mark .parametrize ("dtype" , ["U" , "S" ])
2896
2892
def test_append_string_length_mismatch_raises (self , dtype ) -> None :
2897
- skip_if_zarr_format_3 ("This actually works fine with Zarr format 3" )
2898
2893
ds , ds_to_append = create_append_string_length_mismatch_test_data (dtype )
2899
2894
with self .create_zarr_target () as store_target :
2900
2895
ds .to_zarr (store_target , mode = "w" , ** self .version_kwargs )
@@ -2903,18 +2898,6 @@ def test_append_string_length_mismatch_raises(self, dtype) -> None:
2903
2898
store_target , append_dim = "time" , ** self .version_kwargs
2904
2899
)
2905
2900
2906
- @pytest .mark .parametrize ("dtype" , ["U" , "S" ])
2907
- def test_append_string_length_mismatch_works (self , dtype ) -> None :
2908
- skip_if_zarr_format_2 ("This doesn't work with Zarr format 2" )
2909
- # ...but it probably would if we used object dtype
2910
- ds , ds_to_append = create_append_string_length_mismatch_test_data (dtype )
2911
- expected = xr .concat ([ds , ds_to_append ], dim = "time" )
2912
- with self .create_zarr_target () as store_target :
2913
- ds .to_zarr (store_target , mode = "w" , ** self .version_kwargs )
2914
- ds_to_append .to_zarr (store_target , append_dim = "time" , ** self .version_kwargs )
2915
- actual = xr .open_dataset (store_target , engine = "zarr" )
2916
- xr .testing .assert_identical (expected , actual )
2917
-
2918
2901
def test_check_encoding_is_consistent_after_append (self ) -> None :
2919
2902
ds , ds_to_append , _ = create_append_test_data ()
2920
2903
@@ -2996,6 +2979,11 @@ def test_append_with_append_dim_no_overwrite(self) -> None:
2996
2979
original2 ["lon" ] = lon
2997
2980
assert_identical (original2 , actual )
2998
2981
2982
+ def test_minimal_round (self ) -> None :
2983
+ ds = create_test_data ()
2984
+ with self .roundtrip (ds ) as ds_reload :
2985
+ assert_identical (ds , ds_reload )
2986
+
2999
2987
@requires_dask
3000
2988
def test_to_zarr_compute_false_roundtrip (self ) -> None :
3001
2989
from dask .delayed import Delayed
@@ -3784,10 +3772,6 @@ def roundtrip_dir(
3784
3772
if open_kwargs is None :
3785
3773
open_kwargs = {}
3786
3774
3787
- print ("here?" )
3788
- print (save_kwargs )
3789
- print (self .version_kwargs )
3790
- print (open_kwargs )
3791
3775
data .to_zarr (store , ** save_kwargs , ** self .version_kwargs )
3792
3776
with xr .open_dataset (
3793
3777
store , engine = "zarr" , ** open_kwargs , ** self .version_kwargs
0 commit comments