Skip to content

Commit 584f8a6

Browse files
committed
Enforce kwargs for export
1 parent 90840ce commit 584f8a6

5 files changed

Lines changed: 15 additions & 9 deletions

File tree

weaviate/collections/collections/executor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@
4444
_check_references_generic,
4545
)
4646
from weaviate.collections.collection import Collection, CollectionAsync
47+
from weaviate.collections.config.executor import _any_property_has_text_analyzer
4748
from weaviate.connect import executor
4849
from weaviate.connect.v4 import (
4950
ConnectionAsync,
5051
ConnectionType,
5152
_ExpectedStatusCodes,
5253
)
53-
from weaviate.collections.config.executor import _any_property_has_text_analyzer
5454
from weaviate.exceptions import WeaviateInvalidInputError, WeaviateUnsupportedFeatureError
5555
from weaviate.util import _capitalize_first_letter, _decode_json_response_dict
5656
from weaviate.validator import _validate_input, _ValidateArgument

weaviate/collections/config/executor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
Generic,
66
List,
77
Literal,
8-
Sequence,
98
Optional,
9+
Sequence,
1010
Tuple,
1111
Union,
1212
cast,

weaviate/export/async_.pyi

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,24 @@ class _ExportAsync(_ExportExecutor[ConnectionAsync]):
1414
@overload
1515
async def create(
1616
self,
17+
*,
1718
export_id: str,
1819
backend: ExportStorage,
1920
file_format: ExportFileFormat,
2021
include_collections: Union[List[str], str, None] = None,
2122
exclude_collections: Union[List[str], str, None] = None,
22-
*,
2323
wait_for_completion: Literal[True],
2424
) -> ExportStatusReturn: ...
2525
@overload
2626
async def create(
2727
self,
28+
*,
2829
export_id: str,
2930
backend: ExportStorage,
3031
file_format: ExportFileFormat,
3132
include_collections: Union[List[str], str, None] = None,
3233
exclude_collections: Union[List[str], str, None] = None,
3334
wait_for_completion: Literal[False] = False,
3435
) -> ExportCreateReturn: ...
35-
async def get_status(self, export_id: str, backend: ExportStorage) -> ExportStatusReturn: ...
36-
async def cancel(self, export_id: str, backend: ExportStorage) -> bool: ...
36+
async def get_status(self, *, export_id: str, backend: ExportStorage) -> ExportStatusReturn: ...
37+
async def cancel(self, *, export_id: str, backend: ExportStorage) -> bool: ...

weaviate/export/executor.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,19 @@ def __init__(self, connection: Connection):
4040
@overload
4141
def create(
4242
self,
43+
*,
4344
export_id: str,
4445
backend: ExportStorage,
4546
file_format: ExportFileFormat,
4647
include_collections: Union[List[str], str, None] = None,
4748
exclude_collections: Union[List[str], str, None] = None,
48-
*,
4949
wait_for_completion: Literal[True],
5050
) -> executor.Result[ExportStatusReturn]: ...
5151

5252
@overload
5353
def create(
5454
self,
55+
*,
5556
export_id: str,
5657
backend: ExportStorage,
5758
file_format: ExportFileFormat,
@@ -62,6 +63,7 @@ def create(
6263

6364
def create(
6465
self,
66+
*,
6567
export_id: str,
6668
backend: ExportStorage,
6769
file_format: ExportFileFormat,
@@ -180,6 +182,7 @@ async def _execute() -> Union[ExportCreateReturn, ExportStatusReturn]:
180182

181183
def get_status(
182184
self,
185+
*,
183186
export_id: str,
184187
backend: ExportStorage,
185188
) -> executor.Result[ExportStatusReturn]:
@@ -220,6 +223,7 @@ def resp(res: Response) -> ExportStatusReturn:
220223

221224
def cancel(
222225
self,
226+
*,
223227
export_id: str,
224228
backend: ExportStorage,
225229
) -> executor.Result[bool]:

weaviate/export/sync.pyi

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,24 @@ class _Export(_ExportExecutor[ConnectionSync]):
1616
@overload
1717
def create(
1818
self,
19+
*,
1920
export_id: str,
2021
backend: ExportStorage,
2122
file_format: ExportFileFormat,
2223
include_collections: Union[List[str], str, None] = None,
2324
exclude_collections: Union[List[str], str, None] = None,
24-
*,
2525
wait_for_completion: Literal[True],
2626
) -> ExportStatusReturn: ...
2727
@overload
2828
def create(
2929
self,
30+
*,
3031
export_id: str,
3132
backend: ExportStorage,
3233
file_format: ExportFileFormat,
3334
include_collections: Union[List[str], str, None] = None,
3435
exclude_collections: Union[List[str], str, None] = None,
3536
wait_for_completion: Literal[False] = False,
3637
) -> ExportCreateReturn: ...
37-
def get_status(self, export_id: str, backend: ExportStorage) -> ExportStatusReturn: ...
38-
def cancel(self, export_id: str, backend: ExportStorage) -> bool: ...
38+
def get_status(self, *, export_id: str, backend: ExportStorage) -> ExportStatusReturn: ...
39+
def cancel(self, *, export_id: str, backend: ExportStorage) -> bool: ...

0 commit comments

Comments
 (0)