Skip to content

Commit d2a5fb0

Browse files
committed
Improved typing [skip ci]
1 parent 217a7e3 commit d2a5fb0

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

pgvector/sqlalchemy/bit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from typing import Any
55

66

7-
class BIT(UserDefinedType):
7+
class BIT(UserDefinedType[Any]):
88
cache_ok = True
99

1010
def __init__(self, length: int | None = None) -> None:
@@ -28,7 +28,7 @@ def process(value: Any) -> Any:
2828
else:
2929
return super().bind_processor(dialect)
3030

31-
class Comparator(TypeEngine.Comparator):
31+
class Comparator(TypeEngine.Comparator[Any]):
3232
def hamming_distance(self, other: object) -> Operators:
3333
return self.op('<~>', return_type=Float)(other)
3434

pgvector/sqlalchemy/halfvec.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from .. import HalfVector
66

77

8-
class HALFVEC(UserDefinedType):
8+
class HALFVEC(UserDefinedType[Any]):
99
cache_ok = True
1010
_string = String()
1111

@@ -35,7 +35,7 @@ def process(value: Any) -> HalfVector | None:
3535
return HalfVector._from_db(value)
3636
return process
3737

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

pgvector/sqlalchemy/sparsevec.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from .. import SparseVector
66

77

8-
class SPARSEVEC(UserDefinedType):
8+
class SPARSEVEC(UserDefinedType[Any]):
99
cache_ok = True
1010
_string = String()
1111

@@ -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):
38+
class Comparator(TypeEngine.Comparator[Any]):
3939
def l2_distance(self, other: object) -> Operators:
4040
return self.op('<->', return_type=Float)(other)
4141

pgvector/sqlalchemy/vector.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from .. import Vector
66

77

8-
class VECTOR(UserDefinedType):
8+
class VECTOR(UserDefinedType[Any]):
99
cache_ok = True
1010
_string = String()
1111

@@ -35,7 +35,7 @@ def process(value: Any) -> Vector | None:
3535
return Vector._from_db(value)
3636
return process
3737

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

0 commit comments

Comments
 (0)