-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: stop performing transactional writes on single, unchanged items #23
Conversation
@@ -133,7 +136,12 @@ def boto3_transact_multiple_but_optimize_single(TransactItems: List[dict], **kwa | |||
if set(command) == {"Delete"}: | |||
ddb_client.delete_item(**{**item_args, **kwargs}) | |||
return | |||
# we don't (yet) support single writee optimization for things other than Put or Delete | |||
if set(command) == {"ConditionCheck"}: |
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.
How would we end up with a solitary ConditionCheck?
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.
a put_item where the value is identical to what's currently in the items fetched.
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.
A couple of questions for my own edification. I have not tested it, but your test coverage looks solid.
@jwsloan thanks for the feedback. I've changed the comments and logs to try to make some of this a little more self-explanatory. |
@@ -71,14 +71,17 @@ def _write( | |||
) | |||
|
|||
hashable_item_key = hashable_key(item_key) | |||
if hashable_item_key in items and items[hashable_item_key] == item_or_none: | |||
"""You've asked us to write an effect that would have no effect, and we are dropping it""" |
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.
an ideal language would allow these sorts of docstrings to automatically be logs. In fact, all logs would be docstrings - there would be no function or object to use for logging - the system would simply be aware of an active logger and pass these bare strings into the logger for processing.
closes #22