Skip to content

Commit c9ef7c3

Browse files
committed
Support cassandra.query.BatchType with cqlengine BatchQuery
1 parent aaccf2f commit c9ef7c3

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
Features
55
--------
66
* cqlengine: LIKE filter operator (PYTHON-512)
7+
* Support cassandra.query.BatchType with cqlengine BatchQuery (PYTHON-888)
78

89
Bug Fixes
910
---------

cassandra/cqlengine/query.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def __init__(self, batch_type=None, timestamp=None, consistency=None, execute_on
151151
timeout=conn.NOT_SET, connection=None):
152152
"""
153153
:param batch_type: (optional) One of batch type values available through BatchType enum
154-
:type batch_type: str or None
154+
:type batch_type: BatchType, str or None
155155
:param timestamp: (optional) A datetime or timedelta object with desired timestamp to be applied
156156
to the batch conditional.
157157
:type timestamp: datetime or timedelta or None
@@ -225,7 +225,7 @@ def execute(self):
225225
self._execute_callbacks()
226226
return
227227

228-
opener = 'BEGIN ' + (self.batch_type + ' ' if self.batch_type else '') + ' BATCH'
228+
opener = 'BEGIN ' + (str(self.batch_type) + ' ' if self.batch_type else '') + ' BATCH'
229229
if self.timestamp:
230230

231231
if isinstance(self.timestamp, six.integer_types):

0 commit comments

Comments
 (0)