-
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
versioned_transact_write_items now supports lazy loading of items read #10
versioned_transact_write_items now supports lazy loading of items read #10
Conversation
3714de6
to
537d944
Compare
…d, and optimistic creation/deletion of items without a prefetch
537d944
to
8071ac1
Compare
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.
This is a nice enhancement!
|
||
res = versioned_transact_write_items(opt_delete, dict()) | ||
|
||
assert None is get(res, integration_test_id_table.name, dict(id=test_id_to_delete)) |
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.
Why None is
instead of is None
?
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.
i tend to think that putting the "what" on the left side and the "how" on the right makes things more readable.
this follows the general pattern of most languages and their code.
i'm just not all that consistent about 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.
Interesting. The general pattern I thing I've seen is more actual
on the left and expected
on the right.
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.
i've seen that too, i'm just not sure it makes as much sense. it doesn't fit with the way we use programming languages in general.
there's a big exception to my approach that you may have encountered before:
expected = dict(foo='bar')
assert expected = do_the_actual(...)
I would not advocate putting variable names on the left, because you're risking accidentally assigning and thinking that your test passes when it doesn't.
but if you're writing small tests (which i often don't do), there's likely no need for the intermediate variable, and you could just as safely write
assert dict(foo='bar') == do_the_actual(...)
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.
in the end, as long as it's not ambiguous what you're testing, i'm not going to complain if you do it the other way.
…nsactionAttemptsOverrun exception
@petergaultney when do you think you'll be able to get this merged and published? |
and optimistic creation/deletion of items without a prefetch