66from  typing  import  TYPE_CHECKING , Any , Generic , TypeVar 
77
88from  zarr .abc .codec  import  ArrayArrayCodec , ArrayBytesCodec , BytesBytesCodec 
9- from  zarr .core .common  import  JSON 
109from  zarr .core .config  import  BadConfigError , config 
1110
1211if  TYPE_CHECKING :
1312    from  importlib .metadata  import  EntryPoint 
1413
1514    from  zarr .abc .codec  import  Codec , CodecPipeline 
1615    from  zarr .core .buffer  import  Buffer , NDBuffer 
16+     from  zarr .core .common  import  JSON 
1717
1818__all__  =  [
1919    "Registry" ,
@@ -171,7 +171,7 @@ def _parse_bytes_bytes_codec(data: dict[str, JSON] | BytesBytesCodec) -> BytesBy
171171        result  =  _resolve_codec (data )
172172        if  not  isinstance (result , BytesBytesCodec ):
173173            msg  =  f"Expected a dict representation of a BytesBytesCodec; got a dict representation of a { type (result )}   instead." 
174-             raise  ValueError (msg )
174+             raise  TypeError (msg )
175175    else :
176176        result  =  data 
177177    return  result 
@@ -187,7 +187,7 @@ def _parse_array_bytes_codec(data: dict[str, JSON] | ArrayBytesCodec) -> ArrayBy
187187        result  =  _resolve_codec (data )
188188        if  not  isinstance (result , ArrayBytesCodec ):
189189            msg  =  f"Expected a dict representation of a ArrayBytesCodec; got a dict representation of a { type (result )}   instead." 
190-             raise  ValueError (msg )
190+             raise  TypeError (msg )
191191    else :
192192        result  =  data 
193193    return  result 
@@ -203,7 +203,7 @@ def _parse_array_array_codec(data: dict[str, JSON] | ArrayArrayCodec) -> ArrayAr
203203        result  =  _resolve_codec (data )
204204        if  not  isinstance (result , ArrayArrayCodec ):
205205            msg  =  f"Expected a dict representation of a ArrayArrayCodec; got a dict representation of a { type (result )}   instead." 
206-             raise  ValueError (msg )
206+             raise  TypeError (msg )
207207    else :
208208        result  =  data 
209209    return  result 
0 commit comments