Fix Pull vs Poll naming (#77)

This commit is contained in:
Yuhong Sun 2023-05-22 11:29:50 -07:00 committed by GitHub
parent 0c4dcb13c3
commit 8e9e284849
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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: