22
33import asyncio
44import time
5- from typing import Dict , Generic , List , Literal , Optional , Tuple , Union , overload
5+ from typing import Generic , List , Literal , Tuple , Union , overload
66
77from httpx import Response
88
2020)
2121from weaviate .export .export import (
2222 STORAGE_NAMES ,
23- ExportConfig ,
2423 ExportCreateReturn ,
2524 ExportFileFormat ,
2625 ExportStatus ,
@@ -47,7 +46,6 @@ def create(
4746 exclude_collections : Union [List [str ], str , None ] = None ,
4847 * ,
4948 wait_for_completion : Literal [True ],
50- config : Optional [ExportConfig ] = None ,
5149 ) -> executor .Result [ExportStatusReturn ]: ...
5250
5351 @overload
@@ -59,7 +57,6 @@ def create(
5957 include_collections : Union [List [str ], str , None ] = None ,
6058 exclude_collections : Union [List [str ], str , None ] = None ,
6159 wait_for_completion : Literal [False ] = False ,
62- config : Optional [ExportConfig ] = None ,
6360 ) -> executor .Result [ExportCreateReturn ]: ...
6461
6562 def create (
@@ -70,7 +67,6 @@ def create(
7067 include_collections : Union [List [str ], str , None ] = None ,
7168 exclude_collections : Union [List [str ], str , None ] = None ,
7269 wait_for_completion : bool = False ,
73- config : Optional [ExportConfig ] = None ,
7470 ) -> executor .Result [Union [ExportCreateReturn , ExportStatusReturn ]]:
7571 """Create an export of all/per collection Weaviate objects.
7672
@@ -83,7 +79,6 @@ def create(
8379 exclude_collections: The collection/list of collections to be excluded in the export.
8480 Either `include_collections` or `exclude_collections` can be set.
8581 wait_for_completion: Whether to wait until the export is done. By default False.
86- config: The configuration of the export (path). By default None.
8782
8883 Returns:
8984 An `ExportCreateReturn` object that contains the export creation response.
@@ -114,13 +109,6 @@ def create(
114109 if exclude_collections :
115110 payload ["exclude" ] = exclude_collections
116111
117- if config is not None :
118- config_dict : Dict [str , str ] = {}
119- if config .path is not None :
120- config_dict ["path" ] = config .path
121- if config_dict :
122- payload ["config" ] = config_dict
123-
124112 path = f"/export/{ backend .value } "
125113
126114 if isinstance (self ._connection , ConnectionAsync ):
@@ -141,7 +129,6 @@ async def _execute() -> Union[ExportCreateReturn, ExportStatusReturn]:
141129 self .get_status (
142130 export_id = export_id ,
143131 backend = backend ,
144- config = config ,
145132 )
146133 )
147134 if status .status == ExportStatus .SUCCESS :
@@ -172,7 +159,6 @@ async def _execute() -> Union[ExportCreateReturn, ExportStatusReturn]:
172159 self .get_status (
173160 export_id = export_id ,
174161 backend = backend ,
175- config = config ,
176162 )
177163 )
178164 if status .status == ExportStatus .SUCCESS :
@@ -188,14 +174,12 @@ def get_status(
188174 self ,
189175 export_id : str ,
190176 backend : ExportStorage ,
191- config : Optional [ExportConfig ] = None ,
192177 ) -> executor .Result [ExportStatusReturn ]:
193178 """Check the status of an export.
194179
195180 Args:
196181 export_id: The identifier name of the export.
197182 backend: The backend storage where the export was created.
198- config: The configuration of the export (path). By default None.
199183
200184 Returns:
201185 An `ExportStatusReturn` object that contains the export status response.
@@ -206,9 +190,6 @@ def get_status(
206190 )
207191
208192 url_path = f"/export/{ backend .value } /{ export_id } "
209- params : Dict [str , str ] = {}
210- if config is not None and config .path is not None :
211- params ["path" ] = config .path
212193
213194 def resp (res : Response ) -> ExportStatusReturn :
214195 typed_response = _decode_json_response_dict (res , "Export status check" )
@@ -220,22 +201,19 @@ def resp(res: Response) -> ExportStatusReturn:
220201 response_callback = resp ,
221202 method = self ._connection .get ,
222203 path = url_path ,
223- params = params ,
224204 error_msg = "Export status check failed due to connection error." ,
225205 )
226206
227207 def cancel (
228208 self ,
229209 export_id : str ,
230210 backend : ExportStorage ,
231- config : Optional [ExportConfig ] = None ,
232211 ) -> executor .Result [bool ]:
233212 """Cancel a running export.
234213
235214 Args:
236215 export_id: The identifier name of the export.
237216 backend: The backend storage where the export was created.
238- config: The configuration of the export (path). By default None.
239217
240218 Returns:
241219 True if the export was cancelled, False if the export had already finished.
@@ -245,9 +223,6 @@ def cancel(
245223 backend = backend ,
246224 )
247225 url_path = f"/export/{ backend .value } /{ export_id } "
248- params : Dict [str , str ] = {}
249- if config is not None and config .path is not None :
250- params ["path" ] = config .path
251226
252227 def resp (res : Response ) -> bool :
253228 if res .status_code == 204 :
@@ -261,7 +236,6 @@ def resp(res: Response) -> bool:
261236 response_callback = resp ,
262237 method = self ._connection .delete ,
263238 path = url_path ,
264- params = params ,
265239 error_msg = "Export cancel failed due to connection error." ,
266240 status_codes = _ExpectedStatusCodes (ok_in = [204 , 409 ], error = "cancel export" ),
267241 )
0 commit comments