A single isinstance() check for all types is enough

This commit is contained in:
Pedro Algarvio 2015-08-17 19:56:51 +01:00
parent 503645a72e
commit 51f6a3968c

View File

@ -208,10 +208,8 @@ def cql_query(query, contact_points=None, port=None, cql_user=None, cql_pass=Non
if not isinstance(value, six.text_type):
# Must support Cassandra collection types.
# Namely, Cassandras set, list, and map collections.
if not isinstance(value, set):
if not isinstance(value, list):
if not isinstance(value, dict):
value = str(value)
if not isinstance(value, (set, list, dict)):
value = str(value)
values[key] = value
ret.append(values)