Skip to content

Commit 623a23d

Browse files
committed
[PYTHON-1121] Fix queryset generation for cqlengine Token instances
1 parent 27cbfdd commit 623a23d

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ Bug Fixes
9898
* Call ConnectionException with correct kwargs (PYTHON-1117)
9999
* Can't connect to clusters built from source because version parsing doesn't handle 'x.y-SNAPSHOT' (PYTHON-1118)
100100
* Discovered node doesn´t honor the configured Cluster port on connection (PYTHON-1127)
101+
* Exception when use pk__token__gt filter In python 3.7 (PYTHON-1121)
101102

102103
Other
103104
-----

cassandra/cqlengine/columns.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ class _PartitionKeysToken(Column):
10711071
"""
10721072

10731073
def __init__(self, model):
1074-
self.partition_columns = model._partition_keys.values()
1074+
self.partition_columns = list(model._partition_keys.values())
10751075
super(_PartitionKeysToken, self).__init__(partition_key=True)
10761076

10771077
@property

tests/integration/cqlengine/query/test_queryoperators.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ def test_token_function(self):
9494
# pk__token equality
9595
r = TokenTestModel.objects(pk__token=functions.Token(last_token))
9696
self.assertEqual(len(r), 1)
97+
r.all() # Attempt to obtain queryset for results. This has thrown an exception in the past
9798

9899
def test_compound_pk_token_function(self):
99100

0 commit comments

Comments
 (0)