diff options
author | Wouter Bolsterlee <uws@xs4all.nl> | 2013-05-22 20:11:58 +0200 |
---|---|---|
committer | Wouter Bolsterlee <uws@xs4all.nl> | 2013-05-22 20:11:58 +0200 |
commit | e5419f8daba7b8420d4e00f5f9233d77aeadd394 (patch) | |
tree | 9f0d614e5e6b9ee8f17ae74cfc28f84e9a18f68c /happybase/table.py | |
parent | 7ad4ee8d5c821b33b9d002d3d8c9a355774d173e (diff) | |
download | happybase-e5419f8daba7b8420d4e00f5f9233d77aeadd394.tar.gz |
Also allow 'long' type for 'timestamp' args
Fixes issue #23.
Diffstat (limited to 'happybase/table.py')
-rw-r--r-- | happybase/table.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/happybase/table.py b/happybase/table.py index d512f72..7ed78c1 100644 --- a/happybase/table.py +++ b/happybase/table.py @@ -3,6 +3,7 @@ HappyBase table module. """ import logging +from numbers import Integral from operator import attrgetter from struct import Struct @@ -104,7 +105,7 @@ class Table(object): rows = self.connection.client.getRowWithColumns( self.name, row, columns) else: - if not isinstance(timestamp, int): + if not isinstance(timestamp, Integral): raise TypeError("'timestamp' must be an integer") rows = self.connection.client.getRowWithColumnsTs( self.name, row, columns, timestamp) @@ -144,7 +145,7 @@ class Table(object): results = self.connection.client.getRowsWithColumns( self.name, rows, columns) else: - if not isinstance(timestamp, int): + if not isinstance(timestamp, Integral): raise TypeError("'timestamp' must be an integer") # Work-around a bug in the HBase Thrift server where the @@ -192,7 +193,7 @@ class Table(object): cells = self.connection.client.getVer( self.name, row, column, versions) else: - if not isinstance(timestamp, int): + if not isinstance(timestamp, Integral): raise TypeError("'timestamp' must be an integer") cells = self.connection.client.getVerTs( self.name, row, column, timestamp, versions) |