remove bare list, dict, Sequence, None, Any (#25058)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
@@ -33,7 +33,7 @@ class OpenSearchConfig(BaseModel):
|
||||
|
||||
@model_validator(mode="before")
|
||||
@classmethod
|
||||
def validate_config(cls, values: dict) -> dict:
|
||||
def validate_config(cls, values: dict):
|
||||
if not values.get("host"):
|
||||
raise ValueError("config OPENSEARCH_HOST is required")
|
||||
if not values.get("port"):
|
||||
@@ -128,7 +128,7 @@ class OpenSearchVector(BaseVector):
|
||||
if ids:
|
||||
self.delete_by_ids(ids)
|
||||
|
||||
def delete_by_ids(self, ids: list[str]) -> None:
|
||||
def delete_by_ids(self, ids: list[str]):
|
||||
index_name = self._collection_name.lower()
|
||||
if not self._client.indices.exists(index=index_name):
|
||||
logger.warning("Index %s does not exist", index_name)
|
||||
@@ -159,7 +159,7 @@ class OpenSearchVector(BaseVector):
|
||||
else:
|
||||
logger.exception("Error deleting document: %s", error)
|
||||
|
||||
def delete(self) -> None:
|
||||
def delete(self):
|
||||
self._client.indices.delete(index=self._collection_name.lower())
|
||||
|
||||
def text_exists(self, id: str) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user