Skip to content

PYTHON-336 - Expose LWT results in cqlengine LWTException#488

Merged
aholmberg merged 3 commits into3.1from
336
Feb 24, 2016
Merged

PYTHON-336 - Expose LWT results in cqlengine LWTException#488
aholmberg merged 3 commits into3.1from
336

Conversation

@aholmberg
Copy link
Copy Markdown
Contributor

Superset of #343 and targeting 3.1 dev branch.

dokai and others added 3 commits February 23, 2016 12:35
Adds a custom attribute, `existing`, to the LWTException instance which
allows the application layer to inspect the values read from Cassandra
which conflicted with the attempted conditional write.

The documentation already referred to the `existing` attribute but it
was not implemented.
Comment thread cassandra/cluster.py
Only valid when one of tne of the internal row factories is in use.
"""
if self.response_future.row_factory not in (named_tuple_factory, dict_factory, tuple_factory):
raise RuntimeError("Cannot determine LWT result with row factory %s" % (self.response_future.row_factsory,))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just wondering, should we prefer/force the use of new string formatting (format())?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

core driver uses all '%', so this is consistent within that layer. cqlengine was using format() when we brought it in, but it had to be updated because it used unnamed placeholders. I haven't had time or cause to align the two so I've just been keeping it consistent within each package.

@aboudreault
Copy link
Copy Markdown
Contributor

LGTM!

aholmberg added a commit that referenced this pull request Feb 24, 2016
PYTHON-336 - Expose LWT results in cqlengine LWTException
@aholmberg aholmberg merged commit 853a77a into 3.1 Feb 24, 2016
@aholmberg aholmberg deleted the 336 branch February 24, 2016 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants