Skip to content

Commit c875016

Browse files
committed
Avoid TokenAware failure when keyspace not set
PYTHON-181; fixes KeyError when routing_key set with no keyspace
1 parent cee2f67 commit c875016

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cassandra/policies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def make_query_plan(self, working_keyspace=None, query=None):
359359
yield host
360360
else:
361361
routing_key = query.routing_key
362-
if routing_key is None:
362+
if routing_key is None or keyspace is None:
363363
for host in child.make_query_plan(keyspace, query):
364364
yield host
365365
else:

0 commit comments

Comments
 (0)