From 8e9e284849465494e86304dfcf995557756bc7bd Mon Sep 17 00:00:00 2001 From: Yuhong Sun Date: Mon, 22 May 2023 11:29:50 -0700 Subject: [PATCH] Fix Pull vs Poll naming (#77) --- backend/danswer/connectors/slack/connector.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/danswer/connectors/slack/connector.py b/backend/danswer/connectors/slack/connector.py index 737d470cb63..56db4a0c96e 100644 --- a/backend/danswer/connectors/slack/connector.py +++ b/backend/danswer/connectors/slack/connector.py @@ -251,13 +251,17 @@ def _process_batch_event( class SlackConnector(LoadConnector, PollConnector): def __init__( - self, export_path_str: str, batch_size: int = INDEX_BATCH_SIZE + self, export_path_str: str | None = None, batch_size: int = INDEX_BATCH_SIZE ) -> None: self.export_path_str = export_path_str self.batch_size = batch_size self.client = get_client() def load_from_state(self) -> Generator[list[Document], None, None]: + if self.export_path_str is None: + raise ValueError( + "This Slack connector was not set up with a state-export file." + ) export_path = Path(self.export_path_str) with open(export_path / "channels.json") as f: