@@ -365,8 +365,6 @@ def create_store(self):
365
365
def roundtrip (
366
366
self , data , save_kwargs = None , open_kwargs = None , allow_cleanup_failure = False
367
367
):
368
- print (save_kwargs )
369
- print (open_kwargs )
370
368
if save_kwargs is None :
371
369
save_kwargs = {}
372
370
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
@@ -2333,7 +2328,6 @@ def create_store(self, cache_members: bool = False):
2333
2328
)
2334
2329
2335
2330
def save (self , dataset , store_target , ** kwargs ): # type: ignore[override]
2336
- print ("ver kwargs" , self .version_kwargs )
2337
2331
return dataset .to_zarr (store = store_target , ** kwargs , ** self .version_kwargs )
2338
2332
2339
2333
@contextlib .contextmanager
@@ -2385,7 +2379,8 @@ def test_read_non_consolidated_warning(self) -> None:
2385
2379
2386
2380
def test_non_existent_store (self ) -> None :
2387
2381
with pytest .raises (
2388
- FileNotFoundError , match = "(No such file or directory|Unable to find group)"
2382
+ FileNotFoundError ,
2383
+ match = "(No such file or directory|Unable to find group|No group found in store)" ,
2389
2384
):
2390
2385
xr .open_zarr (f"{ uuid .uuid4 ()} " )
2391
2386
@@ -2467,6 +2462,7 @@ def test_manual_chunk(self) -> None:
2467
2462
assert_identical (actual .load (), auto .load ())
2468
2463
2469
2464
@requires_dask
2465
+ @pytest .mark .filterwarnings ("ignore:.*does not have a Zarr V3 specification.*" )
2470
2466
def test_warning_on_bad_chunks (self ) -> None :
2471
2467
original = create_test_data ().chunk ({"dim1" : 4 , "dim2" : 3 , "dim3" : 3 })
2472
2468
@@ -2875,7 +2871,6 @@ def test_append_with_existing_encoding_raises(self) -> None:
2875
2871
2876
2872
@pytest .mark .parametrize ("dtype" , ["U" , "S" ])
2877
2873
def test_append_string_length_mismatch_raises (self , dtype ) -> None :
2878
- skip_if_zarr_format_3 ("This actually works fine with Zarr format 3" )
2879
2874
ds , ds_to_append = create_append_string_length_mismatch_test_data (dtype )
2880
2875
with self .create_zarr_target () as store_target :
2881
2876
ds .to_zarr (store_target , mode = "w" , ** self .version_kwargs )
@@ -2884,18 +2879,6 @@ def test_append_string_length_mismatch_raises(self, dtype) -> None:
2884
2879
store_target , append_dim = "time" , ** self .version_kwargs
2885
2880
)
2886
2881
2887
- @pytest .mark .parametrize ("dtype" , ["U" , "S" ])
2888
- def test_append_string_length_mismatch_works (self , dtype ) -> None :
2889
- skip_if_zarr_format_2 ("This doesn't work with Zarr format 2" )
2890
- # ...but it probably would if we used object dtype
2891
- ds , ds_to_append = create_append_string_length_mismatch_test_data (dtype )
2892
- expected = xr .concat ([ds , ds_to_append ], dim = "time" )
2893
- with self .create_zarr_target () as store_target :
2894
- ds .to_zarr (store_target , mode = "w" , ** self .version_kwargs )
2895
- ds_to_append .to_zarr (store_target , append_dim = "time" , ** self .version_kwargs )
2896
- actual = xr .open_dataset (store_target , engine = "zarr" )
2897
- xr .testing .assert_identical (expected , actual )
2898
-
2899
2882
def test_check_encoding_is_consistent_after_append (self ) -> None :
2900
2883
ds , ds_to_append , _ = create_append_test_data ()
2901
2884
@@ -2977,6 +2960,11 @@ def test_append_with_append_dim_no_overwrite(self) -> None:
2977
2960
original2 ["lon" ] = lon
2978
2961
assert_identical (original2 , actual )
2979
2962
2963
+ def test_minimal_round (self ) -> None :
2964
+ ds = create_test_data ()
2965
+ with self .roundtrip (ds ) as ds_reload :
2966
+ assert_identical (ds , ds_reload )
2967
+
2980
2968
@requires_dask
2981
2969
def test_to_zarr_compute_false_roundtrip (self ) -> None :
2982
2970
from dask .delayed import Delayed
@@ -3732,10 +3720,6 @@ def roundtrip_dir(
3732
3720
if open_kwargs is None :
3733
3721
open_kwargs = {}
3734
3722
3735
- print ("here?" )
3736
- print (save_kwargs )
3737
- print (self .version_kwargs )
3738
- print (open_kwargs )
3739
3723
data .to_zarr (store , ** save_kwargs , ** self .version_kwargs )
3740
3724
with xr .open_dataset (
3741
3725
store , engine = "zarr" , ** open_kwargs , ** self .version_kwargs
0 commit comments