From fbd792ac7c4d5c62c7b2d6dac9f491be48ed4e4e Mon Sep 17 00:00:00 2001 From: William FH <13333726+hinthornw@users.noreply.github.com> Date: Tue, 29 Aug 2023 12:38:42 -0700 Subject: [PATCH] Fix import (#9945) --- libs/langchain/langchain/chat_loaders/imessage.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/langchain/langchain/chat_loaders/imessage.py b/libs/langchain/langchain/chat_loaders/imessage.py index 10b7f778c8..df2ed95577 100644 --- a/libs/langchain/langchain/chat_loaders/imessage.py +++ b/libs/langchain/langchain/chat_loaders/imessage.py @@ -37,7 +37,7 @@ class IMessageChatLoader(chat_loaders.BaseChatLoader): if not self.db_path.exists(): raise FileNotFoundError(f"File {self.db_path} not found") try: - pass # type: ignore + import sqlite3 # noqa: F401 except ImportError as e: raise ImportError( "The sqlite3 module is required to load iMessage chats.\n" @@ -93,6 +93,7 @@ class IMessageChatLoader(chat_loaders.BaseChatLoader): Yields: ChatSession: Loaded chat session. """ + import sqlite3 try: conn = sqlite3.connect(self.db_path)