From 5254f73a1eb7871f97442c6ac092ff4813a7ba67 Mon Sep 17 00:00:00 2001 From: Adam Holmberg Date: Mon, 25 Apr 2016 13:38:25 -0500 Subject: [PATCH] regenerate column names in named tuple exception --- cassandra/query.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cassandra/query.py b/cassandra/query.py index 7bf3ad5e..1fb4d4cc 100644 --- a/cassandra/query.py +++ b/cassandra/query.py @@ -117,6 +117,7 @@ def named_tuple_factory(colnames, rows): try: Row = namedtuple('Row', clean_column_names) except Exception: + clean_column_names = list(map(_clean_column_name, colnames)) # create list because py3 map object will be consumed by first attempt log.warning("Failed creating named tuple for results with column names %s (cleaned: %s) " "(see Python 'namedtuple' documentation for details on name rules). " "Results will be returned with positional names. "