|
24 | 24 | from onyx.file_store.file_store import get_default_file_store
|
25 | 25 | from onyx.utils.logger import setup_logger
|
26 | 26 |
|
| 27 | + |
27 | 28 | logger = setup_logger()
|
28 | 29 |
|
29 | 30 |
|
@@ -231,21 +232,18 @@ class LocalFileConnector(LoadConnector):
|
231 | 232 |
|
232 | 233 | # Note: file_names is a required parameter, but should not break backwards compatibility.
|
233 | 234 | # If add_file_names migration is not run, old file connector configs will not have file_names.
|
234 |
| - # This is fine because the configs are not re-used to instantiate the connector. |
235 | 235 | # file_names is only used for display purposes in the UI and file_locations is used as a fallback.
|
236 | 236 | def __init__(
|
237 | 237 | self,
|
238 | 238 | file_locations: list[Path | str],
|
239 |
| - file_names: list[ |
240 |
| - str |
241 |
| - ], # Must accept this parameter as connector_specific_config is unpacked as args |
242 |
| - zip_metadata: dict[str, Any], |
| 239 | + file_names: list[str] | None = None, |
| 240 | + zip_metadata: dict[str, Any] | None = None, |
243 | 241 | batch_size: int = INDEX_BATCH_SIZE,
|
244 | 242 | ) -> None:
|
245 | 243 | self.file_locations = [str(loc) for loc in file_locations]
|
246 | 244 | self.batch_size = batch_size
|
247 | 245 | self.pdf_pass: str | None = None
|
248 |
| - self.zip_metadata = zip_metadata |
| 246 | + self.zip_metadata = zip_metadata or {} |
249 | 247 |
|
250 | 248 | def load_credentials(self, credentials: dict[str, Any]) -> dict[str, Any] | None:
|
251 | 249 | self.pdf_pass = credentials.get("pdf_password")
|
|
0 commit comments