Skip to content

Commit 35ee6bf

Browse files
authored
bugfix: conform all connectors to be added to registry (#3408)
### Description Looks like some connectors were never added to the registry explicitly since that change was introduced. All of them are now updated.
1 parent a5c9a36 commit 35ee6bf

File tree

5 files changed

+39
-40
lines changed

5 files changed

+39
-40
lines changed

unstructured/ingest/v2/processes/connectors/__init__.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,20 @@
1818
from .google_drive import google_drive_source_entry
1919
from .local import CONNECTOR_TYPE as LOCAL_CONNECTOR_TYPE
2020
from .local import local_destination_entry, local_source_entry
21+
from .mongodb import CONNECTOR_TYPE as MONGODB_CONNECTOR_TYPE
22+
from .mongodb import mongodb_destination_entry
2123
from .onedrive import CONNECTOR_TYPE as ONEDRIVE_CONNECTOR_TYPE
2224
from .onedrive import onedrive_source_entry
2325
from .opensearch import CONNECTOR_TYPE as OPENSEARCH_CONNECTOR_TYPE
2426
from .opensearch import opensearch_destination_entry, opensearch_source_entry
27+
from .pinecone import CONNECTOR_TYPE as PINECONE_CONNECTOR_TYPE
28+
from .pinecone import pinecone_destination_entry
2529
from .salesforce import CONNECTOR_TYPE as SALESFORCE_CONNECTOR_TYPE
2630
from .salesforce import salesforce_source_entry
31+
from .sharepoint import CONNECTOR_TYPE as SHAREPOINT_CONNECTOR_TYPE
32+
from .sharepoint import sharepoint_source_entry
33+
from .singlestore import CONNECTOR_TYPE as SINGLESTORE_CONNECTOR_TYPE
34+
from .singlestore import singlestore_destination_entry
2735
from .sql import CONNECTOR_TYPE as SQL_CONNECTOR_TYPE
2836
from .sql import sql_destination_entry
2937
from .weaviate import CONNECTOR_TYPE as WEAVIATE_CONNECTOR_TYPE
@@ -59,3 +67,10 @@
5967
)
6068

6169
add_destination_entry(destination_type=SQL_CONNECTOR_TYPE, entry=sql_destination_entry)
70+
71+
add_destination_entry(destination_type=MONGODB_CONNECTOR_TYPE, entry=mongodb_destination_entry)
72+
add_destination_entry(destination_type=PINECONE_CONNECTOR_TYPE, entry=pinecone_destination_entry)
73+
add_source_entry(source_type=SHAREPOINT_CONNECTOR_TYPE, entry=sharepoint_source_entry)
74+
add_destination_entry(
75+
destination_type=SINGLESTORE_CONNECTOR_TYPE, entry=singlestore_destination_entry
76+
)

unstructured/ingest/v2/processes/connectors/mongodb.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
from unstructured.ingest.v2.logger import logger
2020
from unstructured.ingest.v2.processes.connector_registry import (
2121
DestinationRegistryEntry,
22-
add_destination_entry,
2322
)
2423
from unstructured.utils import requires_dependencies
2524

@@ -129,13 +128,10 @@ def run(self, contents: list[UploadContent], **kwargs: Any) -> None:
129128
collection.insert_many(chunk)
130129

131130

132-
add_destination_entry(
133-
destination_type=CONNECTOR_TYPE,
134-
entry=DestinationRegistryEntry(
135-
connection_config=MongoDBConnectionConfig,
136-
uploader=MongoDBUploader,
137-
uploader_config=MongoDBUploaderConfig,
138-
upload_stager=MongoDBUploadStager,
139-
upload_stager_config=MongoDBUploadStagerConfig,
140-
),
131+
mongodb_destination_entry = DestinationRegistryEntry(
132+
connection_config=MongoDBConnectionConfig,
133+
uploader=MongoDBUploader,
134+
uploader_config=MongoDBUploaderConfig,
135+
upload_stager=MongoDBUploadStager,
136+
upload_stager_config=MongoDBUploadStagerConfig,
141137
)

unstructured/ingest/v2/processes/connectors/pinecone.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from unstructured.ingest.v2.logger import logger
2121
from unstructured.ingest.v2.processes.connector_registry import (
2222
DestinationRegistryEntry,
23-
add_destination_entry,
2423
)
2524
from unstructured.staging.base import flatten_dict
2625
from unstructured.utils import requires_dependencies
@@ -170,13 +169,10 @@ def run(self, contents: list[UploadContent], **kwargs: Any) -> None:
170169
)
171170

172171

173-
add_destination_entry(
174-
destination_type=CONNECTOR_TYPE,
175-
entry=DestinationRegistryEntry(
176-
connection_config=PineconeConnectionConfig,
177-
uploader=PineconeUploader,
178-
uploader_config=PineconeUploaderConfig,
179-
upload_stager=PineconeUploadStager,
180-
upload_stager_config=PineconeUploadStagerConfig,
181-
),
172+
pinecone_destination_entry = DestinationRegistryEntry(
173+
connection_config=PineconeConnectionConfig,
174+
uploader=PineconeUploader,
175+
uploader_config=PineconeUploaderConfig,
176+
upload_stager=PineconeUploadStager,
177+
upload_stager_config=PineconeUploadStagerConfig,
182178
)

unstructured/ingest/v2/processes/connectors/sharepoint.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
from unstructured.ingest.v2.logger import logger
2525
from unstructured.ingest.v2.processes.connector_registry import (
2626
SourceRegistryEntry,
27-
add_source_entry,
2827
)
2928
from unstructured.utils import requires_dependencies
3029

@@ -403,13 +402,10 @@ def run(self, file_data: FileData, **kwargs: Any) -> download_responses:
403402
return self.get_site_page(file_data=file_data)
404403

405404

406-
add_source_entry(
407-
source_type=CONNECTOR_TYPE,
408-
entry=SourceRegistryEntry(
409-
connection_config=SharepointConnectionConfig,
410-
indexer_config=SharepointIndexerConfig,
411-
indexer=SharepointIndexer,
412-
downloader_config=SharepointDownloaderConfig,
413-
downloader=SharepointDownloader,
414-
),
405+
sharepoint_source_entry = SourceRegistryEntry(
406+
connection_config=SharepointConnectionConfig,
407+
indexer_config=SharepointIndexerConfig,
408+
indexer=SharepointIndexer,
409+
downloader_config=SharepointDownloaderConfig,
410+
downloader=SharepointDownloader,
415411
)

unstructured/ingest/v2/processes/connectors/singlestore.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
from unstructured.ingest.v2.logger import logger
2525
from unstructured.ingest.v2.processes.connector_registry import (
2626
DestinationRegistryEntry,
27-
add_destination_entry,
2827
)
2928
from unstructured.utils import requires_dependencies
3029

@@ -152,13 +151,10 @@ def run(self, contents: list[UploadContent], **kwargs: Any) -> None:
152151
self.upload_csv(content=content)
153152

154153

155-
add_destination_entry(
156-
destination_type=CONNECTOR_TYPE,
157-
entry=DestinationRegistryEntry(
158-
connection_config=SingleStoreConnectionConfig,
159-
uploader=SingleStoreUploader,
160-
uploader_config=SingleStoreUploaderConfig,
161-
upload_stager=SingleStoreUploadStager,
162-
upload_stager_config=SingleStoreUploadStagerConfig,
163-
),
154+
singlestore_destination_entry = DestinationRegistryEntry(
155+
connection_config=SingleStoreConnectionConfig,
156+
uploader=SingleStoreUploader,
157+
uploader_config=SingleStoreUploaderConfig,
158+
upload_stager=SingleStoreUploadStager,
159+
upload_stager_config=SingleStoreUploadStagerConfig,
164160
)

0 commit comments

Comments
 (0)