Skip to content

Commit 7979c46

Browse files
committed
update
1 parent bf06940 commit 7979c46

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

sdk/search/azure-search-documents/azure/search/documents/_patch.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for license information.
55
# --------------------------------------------------------------------------
6-
# pylint: too-many-instance-attributes
6+
# pylint: disable=too-many-instance-attributes
77
"""Customize generated code here.
88
99
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
@@ -323,14 +323,12 @@ def index_documents(self, batch: IndexDocumentsBatch, **kwargs) -> List[Indexing
323323
return self._index_documents_actions(actions=batch.actions if batch.actions else [], **kwargs)
324324

325325
def _index_documents_actions(self, actions: List[IndexAction], **kwargs) -> List[IndexingResult]:
326-
error_map = {413: RequestEntityTooLargeError}
327-
328326
timeout = kwargs.pop("timeout", 86400)
329327
begin_time = int(time.time())
330328

331329
batch = IndexDocumentsBatch(actions=actions)
332330
try:
333-
batch_response = self._client.index_documents(batch=batch, **kwargs)
331+
batch_response = self._client.index_documents(batch=batch, **kwargs) # pylint: disable=no-member
334332
return cast(List[IndexingResult], batch_response)
335333
except RequestEntityTooLargeError as ex:
336334
if len(actions) == 1:

sdk/search/azure-search-documents/azure/search/documents/models/_patch.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ def _flatten_args(args: Tuple[Union[List[Dict[Any, Any]], List[List[Dict[Any, An
2222
Supports both:
2323
- add_upload_actions([doc1, doc2]) # single list
2424
- add_upload_actions(doc1, doc2) # multiple args
25+
26+
:param args: Variadic arguments containing documents or lists of documents.
27+
:type args: Tuple[Union[List[Dict[Any, Any]], List[List[Dict[Any, Any]]]], ...]
28+
:return: A flattened list of document dictionaries.
29+
:rtype: List[Dict]
2530
"""
2631
if len(args) == 1 and isinstance(args[0], (list, tuple)):
2732
return cast(List[Dict], args[0])

0 commit comments

Comments
 (0)