Skip to content

Commit

Permalink
Update buffered sender (#13851)
Browse files Browse the repository at this point in the history
* Update batching client

* rename SearchIndexDocumentBatchingClient to SearchIndexingBufferedSender
  • Loading branch information
xiangyan99 authored Oct 2, 2020
1 parent e236147 commit a77fbd6
Show file tree
Hide file tree
Showing 34 changed files with 913 additions and 746 deletions.
15 changes: 14 additions & 1 deletion sdk/search/azure-search-documents/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
# Release History

## 11.1.0b3 (Unreleased)
## 11.1.0b3 (2020-10-06)

**Breaking Changes**

- Renamed `SearchIndexDocumentBatchingClient` to `SearchIndexingBufferedSender`
- Renamed `SearchIndexDocumentBatchingClient.add_upload_actions` to `SearchIndexingBufferedSender.upload_documents`
- Renamed `SearchIndexDocumentBatchingClient.add_delete_actions` to `SearchIndexingBufferedSender.delete_documents`
- Renamed `SearchIndexDocumentBatchingClient.add_merge_actions` to `SearchIndexingBufferedSender.merge_documents`
- Renamed `SearchIndexDocumentBatchingClient.add_merge_or_upload_actions` to `SearchIndexingBufferedSender.merge_or_upload_documents`
- Stopped supporting `window` kwargs for `SearchIndexingBufferedSender`
- Splitted kwarg `hook` into `on_new`, `on_progress`, `on_error`, `on_remove` for `SearchIndexingBufferedSender`

**Features**

- Added `auto_flush_interval` support for `SearchIndexingBufferedSender`

## 11.1.0b2 (2020-09-08)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from ._internal._index_documents_batch import IndexDocumentsBatch
from ._internal._search_documents_error import RequestEntityTooLargeError
from ._internal._search_client import SearchClient, SearchItemPaged
from ._internal._search_index_document_batching_client import SearchIndexDocumentBatchingClient
from ._internal._search_indexing_buffered_sender import SearchIndexingBufferedSender
from ._version import VERSION

__version__ = VERSION
Expand All @@ -37,6 +37,6 @@
"IndexDocumentsBatch",
"SearchClient",
"SearchItemPaged",
"SearchIndexDocumentBatchingClient",
"SearchIndexingBufferedSender",
"RequestEntityTooLargeError",
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# ------------------------------------

_SUPPORTED_API_VERSIONS = [
"2019-05-06-Preview",
"2020-06-30",
]

def validate_api_version(api_version):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def add_upload_actions(self, *documents):
"""
return self._extend_batch(_flatten_args(documents), "upload")

def add_delete_actions(self, *documents):
def add_delete_actions(self, *documents, **kwargs): # pylint: disable=unused-argument
# type (Union[List[dict], List[List[dict]]]) -> List[IndexAction]
"""Add documents to delete to the Azure search index.
Expand All @@ -75,7 +75,7 @@ def add_delete_actions(self, *documents):
"""
return self._extend_batch(_flatten_args(documents), "delete")

def add_merge_actions(self, *documents):
def add_merge_actions(self, *documents, **kwargs): # pylint: disable=unused-argument
# type (Union[List[dict], List[List[dict]]]) -> List[IndexAction]
"""Add documents to merge in to existing documets in the Azure search
index.
Expand All @@ -93,7 +93,7 @@ def add_merge_actions(self, *documents):
"""
return self._extend_batch(_flatten_args(documents), "merge")

def add_merge_or_upload_actions(self, *documents):
def add_merge_or_upload_actions(self, *documents, **kwargs): # pylint: disable=unused-argument
# type (Union[List[dict], List[List[dict]]]) -> List[IndexAction]
"""Add documents to merge in to existing documets in the Azure search
index, or upload if they do not yet exist.
Expand All @@ -120,7 +120,7 @@ def actions(self):
"""
return list(self._actions)

def dequeue_actions(self):
def dequeue_actions(self, **kwargs): # pylint: disable=unused-argument
# type: () -> List[IndexAction]
"""Get the list of currently configured index actions and clear it.
Expand All @@ -131,14 +131,14 @@ def dequeue_actions(self):
self._actions = []
return result

def enqueue_actions(self, new_actions):
def enqueue_actions(self, new_actions, **kwargs): # pylint: disable=unused-argument
# type: (List[IndexAction]) -> None
"""Enqueue a list of index actions to index.
"""
with self._lock:
self._actions.extend(new_actions)

def enqueue_action(self, new_action):
def enqueue_action(self, new_action, **kwargs): # pylint: disable=unused-argument
# type: (IndexAction) -> None
"""Enqueue a single index action
"""
Expand Down

This file was deleted.

Loading

0 comments on commit a77fbd6

Please sign in to comment.