diff options
author | Wouter Bolsterlee <uws@xs4all.nl> | 2013-11-08 21:36:46 +0100 |
---|---|---|
committer | Wouter Bolsterlee <uws@xs4all.nl> | 2013-11-08 21:36:46 +0100 |
commit | 3f5bed951741500dbd4aff5d57ba8bf6f0fd2e1b (patch) | |
tree | 00f71d8e7a4ee7e5619348960627228725f46e65 | |
parent | cbd53db579d31a6b9bfe6e419dd7630915728b40 (diff) | |
download | happybase-3f5bed951741500dbd4aff5d57ba8bf6f0fd2e1b.tar.gz |
Compatibility fixes for HBase 0.96
HBase 0.96.0 is more strict wrt column family names without a column
qualifier. In previous versions a trailing ':' character after a column
family name (e.g. 'cf1:') did not make any difference compared to the
version without it (e.g. 'cf1'), but from 0.96.0 this is no longer the
case...
-rw-r--r-- | happybase/table.py | 5 | ||||
-rw-r--r-- | tests/test_api.py | 1 |
2 files changed, 3 insertions, 3 deletions
diff --git a/happybase/table.py b/happybase/table.py index 47a9c69..cb41b9e 100644 --- a/happybase/table.py +++ b/happybase/table.py @@ -50,13 +50,14 @@ class Table(object): descriptors = self.connection.client.getColumnDescriptors(self.name) families = dict() for name, descriptor in descriptors.items(): - name = name[:-1] # drop trailing ':' + name = name.rstrip(':') families[name] = thrift_type_to_dict(descriptor) return families def _column_family_names(self): """Retrieve the column family names for this table (internal use)""" - return self.connection.client.getColumnDescriptors(self.name).keys() + names = self.connection.client.getColumnDescriptors(self.name).keys() + return [name.rstrip(':') for name in names] def regions(self): """Retrieve the regions for this table. diff --git a/tests/test_api.py b/tests/test_api.py index f2deaaf..bb71f37 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -273,7 +273,6 @@ def test_row(): exp = {'cf1:col1': 'v1new', 'cf1:col2': 'v2'} assert_dict_equal(exp, row(row_key, ['cf1'])) - assert_dict_equal(exp, row(row_key, ['cf1:'])) exp = {'cf1:col1': 'v1new', 'cf2:col2': 'v4'} |