From d0af0c404447f2424be5ac2341e568156e529f0c Mon Sep 17 00:00:00 2001 From: Stefan Nica Date: Thu, 23 Nov 2023 10:58:39 +0100 Subject: [PATCH] Fix llama_index mypy errors --- .../llama_index/materializers/document_materializer.py | 8 ++++++-- .../llama_index/materializers/gpt_index_materializer.py | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/zenml/integrations/llama_index/materializers/document_materializer.py b/src/zenml/integrations/llama_index/materializers/document_materializer.py index 9829232a501..18d4fa558f2 100644 --- a/src/zenml/integrations/llama_index/materializers/document_materializer.py +++ b/src/zenml/integrations/llama_index/materializers/document_materializer.py @@ -29,8 +29,12 @@ Document = Any LCDocument = Any else: - from langchain.docstore.document import Document as LCDocument - from llama_index.readers.schema.base import Document + from langchain.docstore.document import ( # type: ignore[import] + Document as LCDocument, + ) + from llama_index.readers.schema.base import ( # type: ignore[import] + Document, + ) class LlamaIndexDocumentMaterializer(LangchainDocumentMaterializer): diff --git a/src/zenml/integrations/llama_index/materializers/gpt_index_materializer.py b/src/zenml/integrations/llama_index/materializers/gpt_index_materializer.py index 51d70709267..c04c3686090 100644 --- a/src/zenml/integrations/llama_index/materializers/gpt_index_materializer.py +++ b/src/zenml/integrations/llama_index/materializers/gpt_index_materializer.py @@ -39,8 +39,12 @@ GPTFaissIndex = Any T = TypeVar("T", bound=Any) else: - from llama_index.indices.base import BaseGPTIndex - from llama_index.indices.vector_store import GPTFaissIndex + from llama_index.indices.base import ( # type: ignore[import] + BaseGPTIndex, + ) + from llama_index.indices.vector_store import ( # type: ignore[import] + GPTFaissIndex, + ) T = TypeVar("T", bound=BaseGPTIndex[Any])