File tree Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -530,14 +530,17 @@ def parse(cls, dtype: None | DataType | Any) -> DataType:
530530 return DataType .float64
531531 if isinstance (dtype , DataType ):
532532 return dtype
533- else :
534- try :
535- dtype = np .dtype (dtype )
536- except (ValueError , TypeError ) as e :
537- raise ValueError (f"Invalid V3 data_type: { dtype } " ) from e
538- # check that this is a valid v3 data_type
539- try :
540- data_type = DataType .from_numpy_dtype (dtype )
541- except KeyError as e :
542- raise ValueError (f"Invalid V3 data_type: { dtype } " ) from e
543- return data_type
533+ try :
534+ return DataType (dtype )
535+ except ValueError :
536+ pass
537+ try :
538+ dtype = np .dtype (dtype )
539+ except (ValueError , TypeError ) as e :
540+ raise ValueError (f"Invalid V3 data_type: { dtype } " ) from e
541+ # check that this is a valid v3 data_type
542+ try :
543+ data_type = DataType .from_numpy_dtype (dtype )
544+ except KeyError as e :
545+ raise ValueError (f"Invalid V3 data_type: { dtype } " ) from e
546+ return data_type
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ def test_config_defaults_set() -> None:
5858 "crc32c" : "zarr.codecs.crc32c_.Crc32cCodec" ,
5959 "sharding_indexed" : "zarr.codecs.sharding.ShardingCodec" ,
6060 "transpose" : "zarr.codecs.transpose.TransposeCodec" ,
61+ "vlen-utf8" : "zarr.codecs.legacy_vlen.VLenUTF8Codec" ,
6162 },
6263 }
6364 ]
You can’t perform that action at this time.
0 commit comments