Skip to content

Commit 0a1da30

Browse files
authored
refactor: more robust method to detect duplicate index (#1651)
1 parent 62ad22a commit 0a1da30

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

docarray/index/backends/weaviate.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,7 @@ def _create_schema(self) -> None:
225225
schema["properties"] = properties
226226
schema["class"] = self.index_name
227227

228-
# TODO: Use exists() instead of contains() when available
229-
# see https://github.com/weaviate/weaviate-python-client/issues/232
230-
if self._client.schema.contains(schema):
228+
if self._client.schema.exists(self.index_name):
231229
logging.warning(
232230
f"Found index {self.index_name} with schema {schema}. Will reuse existing schema."
233231
)

0 commit comments

Comments
 (0)