File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,13 +28,15 @@ def process(value: Any) -> Any:
2828 else :
2929 return super ().bind_processor (dialect )
3030
31- class comparator_factory (TypeEngine .Comparator ):
31+ class Comparator (TypeEngine .Comparator ):
3232 def hamming_distance (self , other : object ) -> Operators :
3333 return self .op ('<~>' , return_type = Float )(other )
3434
3535 def jaccard_distance (self , other : object ) -> Operators :
3636 return self .op ('<%>' , return_type = Float )(other )
3737
38+ comparator_factory = Comparator
39+
3840
3941# for reflection
4042ischema_names ['bit' ] = BIT # type: ignore
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ def process(value: Any) -> HalfVector | None:
3535 return HalfVector ._from_db (value )
3636 return process
3737
38- class comparator_factory (TypeEngine .Comparator ):
38+ class Comparator (TypeEngine .Comparator ):
3939 def l2_distance (self , other : object ) -> Operators :
4040 return self .op ('<->' , return_type = Float )(other )
4141
@@ -48,6 +48,8 @@ def cosine_distance(self, other: object) -> Operators:
4848 def l1_distance (self , other : object ) -> Operators :
4949 return self .op ('<+>' , return_type = Float )(other )
5050
51+ comparator_factory = Comparator
52+
5153
5254# for reflection
5355ischema_names ['halfvec' ] = HALFVEC # type: ignore
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ def process(value: Any) -> SparseVector | None:
3535 return SparseVector ._from_db (value )
3636 return process
3737
38- class comparator_factory (TypeEngine .Comparator ):
38+ class Comparator (TypeEngine .Comparator ):
3939 def l2_distance (self , other : object ) -> Operators :
4040 return self .op ('<->' , return_type = Float )(other )
4141
@@ -48,6 +48,8 @@ def cosine_distance(self, other: object) -> Operators:
4848 def l1_distance (self , other : object ) -> Operators :
4949 return self .op ('<+>' , return_type = Float )(other )
5050
51+ comparator_factory = Comparator
52+
5153
5254# for reflection
5355ischema_names ['sparsevec' ] = SPARSEVEC # type: ignore
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ def process(value: Any) -> Vector | None:
3535 return Vector ._from_db (value )
3636 return process
3737
38- class comparator_factory (TypeEngine .Comparator ):
38+ class Comparator (TypeEngine .Comparator ):
3939 def l2_distance (self , other : object ) -> Operators :
4040 return self .op ('<->' , return_type = Float )(other )
4141
@@ -48,6 +48,8 @@ def cosine_distance(self, other: object) -> Operators:
4848 def l1_distance (self , other : object ) -> Operators :
4949 return self .op ('<+>' , return_type = Float )(other )
5050
51+ comparator_factory = Comparator
52+
5153
5254# for reflection
5355ischema_names ['vector' ] = VECTOR # type: ignore
You can’t perform that action at this time.
0 commit comments