Skip to content

Commit 9bd8146

Browse files
committed
Add CAS WriteType, avoiding KeyError on CAS write timeout
Fixes PYTHON-91
1 parent 25a7acf commit 9bd8146

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

cassandra/policies.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,12 +572,18 @@ class WriteType(object):
572572
internally before a BATCH write.
573573
"""
574574

575+
CAS = 5
576+
"""
577+
A lighweight-transaction write, such as "DELETE ... IF EXISTS".
578+
"""
579+
575580
WriteType.name_to_value = {
576581
'SIMPLE': WriteType.SIMPLE,
577582
'BATCH': WriteType.BATCH,
578583
'UNLOGGED_BATCH': WriteType.UNLOGGED_BATCH,
579584
'COUNTER': WriteType.COUNTER,
580585
'BATCH_LOG': WriteType.BATCH_LOG,
586+
'CAS': WriteType.CAS
581587
}
582588

583589

0 commit comments

Comments
 (0)