@@ -599,15 +599,15 @@ def as_numpy_vector(self) -> BinaryVector:
599599 raise ImportError ("Converting binary to numpy.ndarray requires numpy to be installed." )
600600 dtype , padding = struct .unpack_from ("<sB" , self , 0 )
601601 dtype = BinaryVectorDtype (dtype )
602- match dtype :
603- case BinaryVectorDtype .INT8 :
604- data = np .frombuffer (self [2 :], dtype = "int8" )
605- case BinaryVectorDtype .FLOAT32 :
606- data = np .frombuffer (self [2 :], dtype = "float32" )
607- case BinaryVectorDtype .PACKED_BIT :
608- data = np .frombuffer (self [2 :], dtype = "uint8" )
609- case _ :
610- raise ValueError (f"Unsupported dtype code: { dtype !r} " )
602+
603+ if dtype == BinaryVectorDtype .INT8 :
604+ data = np .frombuffer (self [2 :], dtype = "int8" )
605+ elif dtype == BinaryVectorDtype .FLOAT32 :
606+ data = np .frombuffer (self [2 :], dtype = "float32" )
607+ elif dtype == BinaryVectorDtype .PACKED_BIT :
608+ data = np .frombuffer (self [2 :], dtype = "uint8" )
609+ else :
610+ raise ValueError (f"Unsupported dtype code: { dtype !r} " )
611611 return BinaryVector (data , dtype , padding )
612612
613613 def __getnewargs__ (self ) -> Tuple [bytes , int ]: # type: ignore[override]
0 commit comments