-
Notifications
You must be signed in to change notification settings - Fork 58
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
chore(docs): add basic samples for async data client #940
chore(docs): add basic samples for async data client #940
Conversation
family_id = "stats_summary" | ||
|
||
async with table.mutations_batcher( | ||
flush_limit_mutation_count=2, flush_limit_bytes=1024 |
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.
should we add a comment here saying the default is 100 and is good for most use cases, setting it to 2 just for the example purpose?
Or we don't change the defaults here, and just manually flush in the end. And I would also add some comments on why manual flush is needed, something like "flush will be called automatically when a batch is full, the default batch size is 100".
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.
Ok, maybe I'll remove the arguments here if that's confusing. A manual flush isn't needed since we are using a async with
statement, it will flush and close everything for us at the end of this block
Let me know if you think any extra comments are needed to clarify anything
) | ||
batcher.append( | ||
RowMutationEntry("tablet#a0b81f74#20190502", mutation_list) | ||
) |
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.
do we need to flush?
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.
No, we're using a context manager (async with
), so it will automatically call close for us at the end of the block
This reverts commit 08f6de7.
This PR adds
*_async_*
to the region tagCurrently missing are the samples on the Use filters and Deletes pages. Let me know if you want me to add those as well