Skip to content

Commit c072588

Browse files
committed
Fixed CI
1 parent ffdcea9 commit c072588

4 files changed

Lines changed: 4 additions & 12 deletions

File tree

‎pgvector/sqlalchemy/bit.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@ def process_bind_param(self, value: Any, dialect: Any) -> Any:
1414
return asyncpg.BitString(value) # type: ignore
1515
return value
1616

17-
class Comparator(TypeDecorator.Comparator[Any]):
17+
class comparator_factory(TypeDecorator.Comparator[Any]):
1818
def hamming_distance(self, other: object, /) -> Operators:
1919
return self.op('<~>', return_type=Float)(other)
2020

2121
def jaccard_distance(self, other: object, /) -> Operators:
2222
return self.op('<%>', return_type=Float)(other)
23-
24-
comparator_factory = Comparator # type: ignore

‎pgvector/sqlalchemy/halfvec.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def process(value: Any) -> list[float] | None:
3535
return HalfVector._from_db(value)
3636
return process
3737

38-
class Comparator(TypeEngine.Comparator[Any]):
38+
class comparator_factory(TypeEngine.Comparator[Any]):
3939
def l2_distance(self, other: object, /) -> Operators:
4040
return self.op('<->', return_type=Float)(other)
4141

@@ -48,8 +48,6 @@ 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-
5351

5452
# for reflection
5553
ischema_names['halfvec'] = HALFVEC # type: ignore

‎pgvector/sqlalchemy/sparsevec.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff 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(TypeEngine.Comparator[Any]):
38+
class comparator_factory(TypeEngine.Comparator[Any]):
3939
def l2_distance(self, other: object, /) -> Operators:
4040
return self.op('<->', return_type=Float)(other)
4141

@@ -48,8 +48,6 @@ 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-
5351

5452
# for reflection
5553
ischema_names['sparsevec'] = SPARSEVEC # type: ignore

‎pgvector/sqlalchemy/vector.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def process(value: Any) -> list[float] | None:
3535
return Vector._from_db(value)
3636
return process
3737

38-
class Comparator(TypeEngine.Comparator[Any]):
38+
class comparator_factory(TypeEngine.Comparator[Any]):
3939
def l2_distance(self, other: object, /) -> Operators:
4040
return self.op('<->', return_type=Float)(other)
4141

@@ -48,8 +48,6 @@ 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-
5351

5452
# for reflection
5553
ischema_names['vector'] = VECTOR # type: ignore

0 commit comments

Comments
 (0)