File tree Expand file tree Collapse file tree
vectordb_bench/backend/clients Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from abc import ABC , abstractmethod
22from contextlib import contextmanager
3- from enum import Enum
3+ from enum import StrEnum
44
55from pydantic import BaseModel , SecretStr , validator
66
77from vectordb_bench .backend .filter import Filter , FilterOp
88
99
10- class MetricType (str , Enum ):
10+ class MetricType (StrEnum ):
1111 L2 = "L2"
1212 COSINE = "COSINE"
1313 IP = "IP"
@@ -16,7 +16,7 @@ class MetricType(str, Enum):
1616 JACCARD = "JACCARD"
1717
1818
19- class IndexType (str , Enum ):
19+ class IndexType (StrEnum ):
2020 HNSW = "HNSW"
2121 HNSW_SQ = "HNSW_SQ"
2222 HNSW_BQ = "HNSW_BQ"
@@ -47,7 +47,7 @@ class IndexType(str, Enum):
4747 NONE = "NONE"
4848
4949
50- class SQType (str , Enum ):
50+ class SQType (StrEnum ):
5151 SQ6 = "SQ6"
5252 SQ8 = "SQ8"
5353 BF16 = "BF16"
Original file line number Diff line number Diff line change 1- from enum import Enum
1+ from enum import StrEnum
22
33from pydantic import BaseModel , SecretStr
44
@@ -16,7 +16,7 @@ def to_dict(self) -> dict:
1616 }
1717
1818
19- class ESElementType (str , Enum ):
19+ class ESElementType (StrEnum ):
2020 float = "float" # 4 byte
2121 byte = "byte" # 1 byte, -128 to 127
2222
Original file line number Diff line number Diff line change 1- from enum import Enum
1+ from enum import StrEnum
22
33from pydantic import BaseModel , SecretStr
44
@@ -20,7 +20,7 @@ def to_dict(self) -> dict:
2020 }
2121
2222
23- class ESElementType (str , Enum ):
23+ class ESElementType (StrEnum ):
2424 float = "float" # 4 byte
2525 byte = "byte" # 1 byte, -128 to 127
2626
You can’t perform that action at this time.
0 commit comments