|
4 | 4 | from pathlib import Path
|
5 | 5 | from typing import Any
|
6 | 6 | from typing import IO
|
7 |
| -from typing import Optional |
8 | 7 |
|
9 | 8 | from onyx.configs.app_configs import INDEX_BATCH_SIZE
|
10 | 9 | from onyx.configs.constants import DocumentSource
|
@@ -236,21 +235,13 @@ class LocalFileConnector(LoadConnector):
|
236 | 235 | def __init__(
|
237 | 236 | self,
|
238 | 237 | file_locations: list[Path | str],
|
239 |
| - file_names: Optional[list[str]] = None, # Must accept this parameter as connector_specific_config is unpacked as args |
240 |
| - zip_metadata: Optional[dict[str, Any]] = None, |
| 238 | + file_names: list[str] | None = None, |
| 239 | + zip_metadata: dict[str, Any] | None = None, |
241 | 240 | batch_size: int = INDEX_BATCH_SIZE,
|
242 | 241 | ) -> None:
|
243 | 242 | self.file_locations = [str(loc) for loc in file_locations]
|
244 |
| - |
245 |
| - # Resolve file_names: prefer explicit list, fall back to locations |
246 |
| - if file_names is None: |
247 |
| - file_names = self.file_locations |
248 |
| - else: |
249 |
| - # Ensure we have a concrete list of strings |
250 |
| - file_names = [str(name) for name in file_names] |
251 |
| - |
252 | 243 | self.batch_size = batch_size
|
253 |
| - self.pdf_pass: Optional[str] = None |
| 244 | + self.pdf_pass: str | None = None |
254 | 245 | self.zip_metadata = zip_metadata or {}
|
255 | 246 |
|
256 | 247 | def load_credentials(self, credentials: dict[str, Any]) -> dict[str, Any] | None:
|
|
0 commit comments