diff options
author | Sean Morgan <seanmorgan91@gmail.com> | 2017-01-30 12:28:48 -0500 |
---|---|---|
committer | Sean Morgan <spmorgan@micron.com> | 2017-01-30 12:28:48 -0500 |
commit | ba76beee9d4e435254813899f82ca72b5d237a91 (patch) | |
tree | 0bb4e8b3fc62b70a5ea10ecba9ecd755c947336c /happybase/table.py | |
parent | e085b9c1b666421fbe309450669171d31b12d328 (diff) | |
download | happybase-ba76beee9d4e435254813899f82ca72b5d237a91.tar.gz |
Rename to reverse, minor code fixes
Diffstat (limited to 'happybase/table.py')
-rw-r--r-- | happybase/table.py | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/happybase/table.py b/happybase/table.py index f6dcc10..d0469e1 100644 --- a/happybase/table.py +++ b/happybase/table.py @@ -222,7 +222,7 @@ class Table(object): def scan(self, row_start=None, row_stop=None, row_prefix=None, columns=None, filter=None, timestamp=None, include_timestamp=False, batch_size=1000, scan_batching=None, - limit=None, sorted_columns=False, reversed=False): + limit=None, sorted_columns=False, reverse=False): """Create a scanner for data in the table. This method returns an iterable that can be used for looping over the @@ -267,8 +267,8 @@ class Table(object): If `sorted_columns` is `True`, the columns in the rows returned by this scanner will be retrieved in sorted order, and the data will be stored in `OrderedDict` instances. - - If `reversed` is `True`, the scanner will perform the scan in reverse. + + If `reverse` is `True`, the scanner will perform the scan in reverse. This means that `row_start` must be lexicographically after `row_stop`. Note that the start of the range is inclusive, while the end is exclusive just as in the forward scan. @@ -282,8 +282,11 @@ class Table(object): * The `sorted_columns` argument is only available when using HBase 0.96 (or up). - * The `reversed` argument is only available when using HBase 0.98 - (or up) + * The `reverse` argument is only available when using HBase 0.98 + (or up). + + .. versionadded:: TODO + `reverse` argument .. versionadded:: 0.8 `sorted_columns` argument @@ -302,7 +305,7 @@ class Table(object): :param bool scan_batching: server-side scan batching (optional) :param int limit: max number of rows to return :param bool sorted_columns: whether to return sorted columns - :param bool reversed: whether to perform scan in reverse + :param bool reverse: whether to perform scan in reverse :return: generator yielding the rows matching the scan :rtype: iterable of `(row_key, row_data)` tuples @@ -320,9 +323,9 @@ class Table(object): raise NotImplementedError( "'sorted_columns' is only supported in HBase >= 0.96") - if reversed and self.connection.compat < '0.98': + if reverse and self.connection.compat < '0.98': raise NotImplementedError( - "'reversed' is only supported in HBase >= 0.98") + "'reverse' is only supported in HBase >= 0.98") if row_prefix is not None: if row_start is not None or row_stop is not None: @@ -330,7 +333,7 @@ class Table(object): "'row_prefix' cannot be combined with 'row_start' " "or 'row_stop'") - if reversed: + if reverse: row_start = bytes_increment(row_prefix) row_stop = row_prefix else: @@ -393,7 +396,7 @@ class Table(object): filterString=filter, batchSize=scan_batching, sortColumns=sorted_columns, - reversed=reversed + reversed=reverse, ) scan_id = self.connection.client.scannerOpenWithScan( self.name, scan, {}) |