Skip to content

Commit

Permalink
Merge pull request #24 from dhermes/cut-0.25.0
Browse files Browse the repository at this point in the history
Cutting release 0.25.0.
  • Loading branch information
dhermes committed Jul 19, 2017
2 parents 3e014d1 + 89ea476 commit ff7734d
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 23 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@


REQUIREMENTS = [
'google-cloud-bigtable >= 0.24.0, < 0.25dev',
'google-cloud-bigtable >= 0.25.0, < 0.26dev',
]

SETUP_BASE.pop('url')

setup(
name='google-cloud-happybase',
version='0.24.0',
version='0.25.0',
description='Client library for Google Cloud Bigtable: HappyBase layer',
long_description=README,
url='https://github.com/GoogleCloudPlatform/google-cloud-python-happybase',
Expand Down
7 changes: 4 additions & 3 deletions src/google/cloud/happybase/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,13 @@ def _get_instance(timeout=None):
client = Client(**client_kwargs)
instances, failed_locations = client.list_instances()

if len(failed_locations) != 0:
if failed_locations:
raise ValueError('Determining instance via ListInstances encountered '
'failed locations.')
if len(instances) == 0:
num_instances = len(instances)
if num_instances == 0:
raise ValueError('This client doesn\'t have access to any instances.')
if len(instances) > 1:
if num_instances > 1:
raise ValueError('This client has access to more than one instance. '
'Please directly pass the instance you\'d '
'like to use.')
Expand Down
2 changes: 2 additions & 0 deletions src/google/cloud/happybase/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ def connection(self, timeout=None):
:param timeout: (Optional) Time (in seconds) to wait for a connection
to open.
:rtype: :class:`~google.cloud.happybase.connection.Connection`
:returns: (Rather, yields) a connection from the queue.
:raises: :class:`NoConnectionsAvailable` if no connection can be
retrieved from the pool before the ``timeout`` (only if
a timeout is specified).
Expand Down
25 changes: 14 additions & 11 deletions src/google/cloud/happybase/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,17 +284,17 @@ def cells(self, row, column, versions=None, timestamp=None,
partial_row_data = self._low_level_table.read_row(row, filter_=filter_)
if partial_row_data is None:
return []
else:
cells = partial_row_data._cells
# We know that `_filter_chain_helper` has already verified that
# column will split as such.
column_family_id, column_qualifier = column.split(':')
# NOTE: We expect the only key in `cells` is `column_family_id`
# and the only key `cells[column_family_id]` is
# `column_qualifier`. But we don't check that this is true.
curr_cells = cells[column_family_id][column_qualifier]
return _cells_to_pairs(
curr_cells, include_timestamp=include_timestamp)

cells = partial_row_data._cells
# We know that `_filter_chain_helper` has already verified that
# column will split as such.
column_family_id, column_qualifier = column.split(':')
# NOTE: We expect the only key in `cells` is `column_family_id`
# and the only key `cells[column_family_id]` is
# `column_qualifier`. But we don't check that this is true.
curr_cells = cells[column_family_id][column_qualifier]
return _cells_to_pairs(
curr_cells, include_timestamp=include_timestamp)

def scan(self, row_start=None, row_stop=None, row_prefix=None,
columns=None, timestamp=None,
Expand Down Expand Up @@ -374,6 +374,9 @@ def scan(self, row_start=None, row_stop=None, row_prefix=None,
:param kwargs: Remaining keyword arguments. Provided for HappyBase
compatibility.
:rtype: tuple
:returns: (Rather, yields) pairs of row key and the dictionary of
values encountered in that row.
:raises: If ``limit`` is set but non-positive, or if ``row_prefix`` is
used with row start/stop,
:class:`TypeError <exceptions.TypeError>` if a string
Expand Down
6 changes: 3 additions & 3 deletions system_tests/system_test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ def unique_resource_id(delimiter='_'):
build_id = os.getenv('TRAVIS_BUILD_ID', '')
if build_id == '':
return '%s%d' % (delimiter, 1000 * time.time())
else:
return '%s%s%s%d' % (delimiter, build_id,
delimiter, time.time())

return '%s%s%s%d' % (delimiter, build_id,
delimiter, time.time())
4 changes: 2 additions & 2 deletions unit_tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,8 +635,8 @@ def copy(self):
result = self.copies[0]
self.copies[:] = self.copies[1:]
return result
else:
return self

return self

def list_tables(self):
return self.list_tables_result
Expand Down
4 changes: 2 additions & 2 deletions unit_tests/test_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ def copy(self):
result = self.copies[0]
self.copies[:] = self.copies[1:]
return result
else:
return self

return self


class _Queue(object):
Expand Down

0 comments on commit ff7734d

Please sign in to comment.