summaryrefslogtreecommitdiff
path: root/happybase
diff options
context:
space:
mode:
authorWouter Bolsterlee <uws@xs4all.nl>2016-03-20 22:31:49 +0100
committerWouter Bolsterlee <wouter@bolsterl.ee>2016-07-27 19:08:46 +0200
commitc913e7c950736ff44183544897fc375cde166dd3 (patch)
tree6c4698f7857fe95f00b03861f53d8261cb3cca2a /happybase
parentf5652822120041bfdde642a55f564f94a5d147fc (diff)
downloadhappybase-c913e7c950736ff44183544897fc375cde166dd3.tar.gz
Use list comprehension instead of calling map()
...which behaves differently on Python 3.
Diffstat (limited to 'happybase')
-rw-r--r--happybase/table.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/happybase/table.py b/happybase/table.py
index c0f2752..d4f490a 100644
--- a/happybase/table.py
+++ b/happybase/table.py
@@ -77,7 +77,7 @@ class Table(object):
:rtype: list of dicts
"""
regions = self.connection.client.getTableRegions(self.name)
- return map(thrift_type_to_dict, regions)
+ return [thrift_type_to_dict(r) for r in regions]
#
# Data retrieval
@@ -210,10 +210,8 @@ class Table(object):
cells = self.connection.client.getVerTs(
self.name, row, column, timestamp, versions, {})
- if include_timestamp:
- return map(make_cell_timestamp, cells)
- else:
- return map(make_cell, cells)
+ f = make_cell_timestamp if include_timestamp else make_cell
+ return [f(c) for c in cells]
def scan(self, row_start=None, row_stop=None, row_prefix=None,
columns=None, filter=None, timestamp=None,