Skip to content
Prev Previous commit
Next Next commit
refactor: rewrite schema check for reuse
  • Loading branch information
hsm207 committed Jul 10, 2023
commit 6cb88102a8dbe47c6f96db5e030c65426ec0c30f
4 changes: 1 addition & 3 deletions docarray/index/backends/weaviate.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,7 @@ def _create_schema(self) -> None:
schema["properties"] = properties
schema["class"] = self.index_name

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