Skip to content
This repository was archived by the owner on Dec 10, 2025. It is now read-only.

Commit ff7734d

Browse files
authored
Merge pull request #24 from dhermes/cut-0.25.0
Cutting release 0.25.0.
2 parents 3e014d1 + 89ea476 commit ff7734d

File tree

7 files changed

+29
-23
lines changed

7 files changed

+29
-23
lines changed

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@
5151

5252

5353
REQUIREMENTS = [
54-
'google-cloud-bigtable >= 0.24.0, < 0.25dev',
54+
'google-cloud-bigtable >= 0.25.0, < 0.26dev',
5555
]
5656

5757
SETUP_BASE.pop('url')
5858

5959
setup(
6060
name='google-cloud-happybase',
61-
version='0.24.0',
61+
version='0.25.0',
6262
description='Client library for Google Cloud Bigtable: HappyBase layer',
6363
long_description=README,
6464
url='https://github.com/GoogleCloudPlatform/google-cloud-python-happybase',

src/google/cloud/happybase/connection.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,13 @@ def _get_instance(timeout=None):
8787
client = Client(**client_kwargs)
8888
instances, failed_locations = client.list_instances()
8989

90-
if len(failed_locations) != 0:
90+
if failed_locations:
9191
raise ValueError('Determining instance via ListInstances encountered '
9292
'failed locations.')
93-
if len(instances) == 0:
93+
num_instances = len(instances)
94+
if num_instances == 0:
9495
raise ValueError('This client doesn\'t have access to any instances.')
95-
if len(instances) > 1:
96+
if num_instances > 1:
9697
raise ValueError('This client has access to more than one instance. '
9798
'Please directly pass the instance you\'d '
9899
'like to use.')

src/google/cloud/happybase/pool.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ def connection(self, timeout=None):
120120
:param timeout: (Optional) Time (in seconds) to wait for a connection
121121
to open.
122122
123+
:rtype: :class:`~google.cloud.happybase.connection.Connection`
124+
:returns: (Rather, yields) a connection from the queue.
123125
:raises: :class:`NoConnectionsAvailable` if no connection can be
124126
retrieved from the pool before the ``timeout`` (only if
125127
a timeout is specified).

src/google/cloud/happybase/table.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -284,17 +284,17 @@ def cells(self, row, column, versions=None, timestamp=None,
284284
partial_row_data = self._low_level_table.read_row(row, filter_=filter_)
285285
if partial_row_data is None:
286286
return []
287-
else:
288-
cells = partial_row_data._cells
289-
# We know that `_filter_chain_helper` has already verified that
290-
# column will split as such.
291-
column_family_id, column_qualifier = column.split(':')
292-
# NOTE: We expect the only key in `cells` is `column_family_id`
293-
# and the only key `cells[column_family_id]` is
294-
# `column_qualifier`. But we don't check that this is true.
295-
curr_cells = cells[column_family_id][column_qualifier]
296-
return _cells_to_pairs(
297-
curr_cells, include_timestamp=include_timestamp)
287+
288+
cells = partial_row_data._cells
289+
# We know that `_filter_chain_helper` has already verified that
290+
# column will split as such.
291+
column_family_id, column_qualifier = column.split(':')
292+
# NOTE: We expect the only key in `cells` is `column_family_id`
293+
# and the only key `cells[column_family_id]` is
294+
# `column_qualifier`. But we don't check that this is true.
295+
curr_cells = cells[column_family_id][column_qualifier]
296+
return _cells_to_pairs(
297+
curr_cells, include_timestamp=include_timestamp)
298298

299299
def scan(self, row_start=None, row_stop=None, row_prefix=None,
300300
columns=None, timestamp=None,
@@ -374,6 +374,9 @@ def scan(self, row_start=None, row_stop=None, row_prefix=None,
374374
:param kwargs: Remaining keyword arguments. Provided for HappyBase
375375
compatibility.
376376
377+
:rtype: tuple
378+
:returns: (Rather, yields) pairs of row key and the dictionary of
379+
values encountered in that row.
377380
:raises: If ``limit`` is set but non-positive, or if ``row_prefix`` is
378381
used with row start/stop,
379382
:class:`TypeError <exceptions.TypeError>` if a string

system_tests/system_test_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,6 @@ def unique_resource_id(delimiter='_'):
6464
build_id = os.getenv('TRAVIS_BUILD_ID', '')
6565
if build_id == '':
6666
return '%s%d' % (delimiter, 1000 * time.time())
67-
else:
68-
return '%s%s%s%d' % (delimiter, build_id,
69-
delimiter, time.time())
67+
68+
return '%s%s%s%d' % (delimiter, build_id,
69+
delimiter, time.time())

unit_tests/test_connection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,8 +635,8 @@ def copy(self):
635635
result = self.copies[0]
636636
self.copies[:] = self.copies[1:]
637637
return result
638-
else:
639-
return self
638+
639+
return self
640640

641641
def list_tables(self):
642642
return self.list_tables_result

unit_tests/test_pool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ def copy(self):
236236
result = self.copies[0]
237237
self.copies[:] = self.copies[1:]
238238
return result
239-
else:
240-
return self
239+
240+
return self
241241

242242

243243
class _Queue(object):

0 commit comments

Comments
 (0)