Skip to content

Commit 16bf124

Browse files
committed
Remove export path parameter
1 parent 9244484 commit 16bf124

5 files changed

Lines changed: 7 additions & 55 deletions

File tree

weaviate/classes/export.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
from weaviate.export.export import (
2-
ExportConfig,
32
ExportFileFormat,
43
ExportStorage,
54
)
65

76
__all__ = [
8-
"ExportConfig",
97
"ExportFileFormat",
108
"ExportStorage",
119
]

weaviate/export/async_.pyi

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
from typing import List, Literal, Optional, Union, overload
1+
from typing import List, Literal, Union, overload
22

33
from weaviate.connect.v4 import ConnectionAsync
44
from weaviate.export.export import (
5-
ExportConfig,
65
ExportCreateReturn,
76
ExportFileFormat,
87
ExportStatusReturn,
@@ -22,7 +21,6 @@ class _ExportAsync(_ExportExecutor[ConnectionAsync]):
2221
exclude_collections: Union[List[str], str, None] = None,
2322
*,
2423
wait_for_completion: Literal[True],
25-
config: Optional[ExportConfig] = None,
2624
) -> ExportStatusReturn: ...
2725
@overload
2826
async def create(
@@ -33,11 +31,6 @@ class _ExportAsync(_ExportExecutor[ConnectionAsync]):
3331
include_collections: Union[List[str], str, None] = None,
3432
exclude_collections: Union[List[str], str, None] = None,
3533
wait_for_completion: Literal[False] = False,
36-
config: Optional[ExportConfig] = None,
3734
) -> ExportCreateReturn: ...
38-
async def get_status(
39-
self, export_id: str, backend: ExportStorage, config: Optional[ExportConfig] = None
40-
) -> ExportStatusReturn: ...
41-
async def cancel(
42-
self, export_id: str, backend: ExportStorage, config: Optional[ExportConfig] = None
43-
) -> bool: ...
35+
async def get_status(self, export_id: str, backend: ExportStorage) -> ExportStatusReturn: ...
36+
async def cancel(self, export_id: str, backend: ExportStorage) -> bool: ...

weaviate/export/executor.py

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import asyncio
44
import time
5-
from typing import Dict, Generic, List, Literal, Optional, Tuple, Union, overload
5+
from typing import Generic, List, Literal, Tuple, Union, overload
66

77
from httpx import Response
88

@@ -20,7 +20,6 @@
2020
)
2121
from 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
)

weaviate/export/export.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,6 @@ class ShardExportStatus(str, Enum):
4848
SKIPPED = "SKIPPED"
4949

5050

51-
class ExportConfig(BaseModel):
52-
"""Configuration for where to write the export."""
53-
54-
path: Optional[str] = None
55-
56-
5751
class ShardProgress(BaseModel):
5852
"""Progress of a single shard export."""
5953

weaviate/export/sync.pyi

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
from typing import List, Literal, Optional, Union, overload
1+
from typing import List, Literal, Union, overload
22

33
from weaviate.connect.v4 import ConnectionSync
44
from weaviate.export.export import (
5-
ExportConfig,
65
ExportCreateReturn,
76
ExportFileFormat,
87
ExportStatusReturn,
@@ -22,7 +21,6 @@ class _Export(_ExportExecutor[ConnectionSync]):
2221
exclude_collections: Union[List[str], str, None] = None,
2322
*,
2423
wait_for_completion: Literal[True],
25-
config: Optional[ExportConfig] = None,
2624
) -> ExportStatusReturn: ...
2725
@overload
2826
def create(
@@ -33,11 +31,6 @@ class _Export(_ExportExecutor[ConnectionSync]):
3331
include_collections: Union[List[str], str, None] = None,
3432
exclude_collections: Union[List[str], str, None] = None,
3533
wait_for_completion: Literal[False] = False,
36-
config: Optional[ExportConfig] = None,
3734
) -> ExportCreateReturn: ...
38-
def get_status(
39-
self, export_id: str, backend: ExportStorage, config: Optional[ExportConfig] = None
40-
) -> ExportStatusReturn: ...
41-
def cancel(
42-
self, export_id: str, backend: ExportStorage, config: Optional[ExportConfig] = None
43-
) -> bool: ...
35+
def get_status(self, export_id: str, backend: ExportStorage) -> ExportStatusReturn: ...
36+
def cancel(self, export_id: str, backend: ExportStorage) -> bool: ...

0 commit comments

Comments
 (0)