-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update buffered sender #13851
Update buffered sender #13851
Conversation
_RETRY_LIMIT = 10 | ||
_DEFAULT_AUTO_FLUSH_INTERVAL = 60 | ||
_DEFAULT_BATCH_SIZE = 100 | ||
_MAX_RETRY_COUNT = 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tiniest nit: can you also call this _DEFAULT_MAX_RETRY_COUNT
assert client._window == 100 | ||
assert client._auto_flush | ||
await client.close() | ||
async with SearchIndexDocumentBatchingClient("endpoint", "index name", CREDENTIAL, window=100) as client: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't look like you have tests for the new kwargs (i.e. error_callback
, progress_callback
etc). can you add tests for these?
**Breaking Changes** | ||
|
||
- Stopped supporting `window` kwargs for `SearchIndexDocumentBatchingClient` | ||
- Splitted kwarg `hook` into `new_callback`, `progress_callback`, `error_callback`, `remove_callback` for `SearchIndexDocumentBatchingClient` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We continue to use the suffix _hook
or the prefix on_
to represent callbacks in other SDKs - are we able to align?
e.g.
- storage blobs
on_error
- event hubs
on_error
/on_partition_initialize
etc - In Datalake we use the
_hook
suffix when the callback handles a few different operations (e.g. not just errors).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update changelog to reflect new on_
prefix to callbacks
**Breaking Changes** | ||
|
||
- Stopped supporting `window` kwargs for `SearchIndexDocumentBatchingClient` | ||
- Splitted kwarg `hook` into `new_callback`, `progress_callback`, `error_callback`, `remove_callback` for `SearchIndexDocumentBatchingClient` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update changelog to reflect new on_
prefix to callbacks
# type: (List[dict]) -> None | ||
"""Queue upload documents actions. | ||
|
||
:param documents: A list of documents to upload. | ||
:type documents: List[dict] | ||
""" | ||
actions = self._index_documents_batch.add_upload_actions(documents) | ||
self._new_callback(actions) | ||
self._new_action_callback(actions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: i think it would be more clear if the private variables tracking the on_
hooks were named the same as what users would pass in (in this case, self._on_new)
…into fr-business-cards * 'master' of https://github.com/Azure/azure-sdk-for-python: (71 commits) move the environment prep above the tooling that needs it (#14246) Increment version for appconfiguration releases (#14245) Azure Communication Service - Phone Number Administration (#14237) [text analytics] fix query param in cli call to get endpoint (#14243) Resolve Failing Documentation Build for azure-mgmt-core (#14239) Add code reviewers (#14229) [ServiceBus] make amqp_message properties read-only (#14095) [ServiceBus]remove topic parameter object settability (#14116) app config owner (#12986) [KeyVault] Handle Role Definition UUID Name Internally (#14218) Increment version for storage releases (#14224) Update Key Vault changelogs for October release (#14226) [ServiceBus] CI Test hotfixes (#14195) [text analytics] regen TA with GA autorest (#14215) [Storage][STG74]ChangeLog (#14192) fixes python 2.7 issue with unicode and strings again! (#14216) Feature/storage stg74 (#14175) Update communication pacakges to version b2 (#14209) [KeyVault] Add Status Methods to Query Backup and Restore Operations (#14158) Update buffered sender (#13851) ...
window
kwargs forSearchIndexDocumentBatchingClient
hook
intonew_callback
,progress_callback
,error_callback
,remove_callback
forSearchIndexDocumentBatchingClient
auto_flush_interval
support forSearchIndexDocumentBatchingClient
max_retry_count
support forSearchIndexDocumentBatchingClient