From 193e3e97983bae0377c11f6e9a18423c4695d682 Mon Sep 17 00:00:00 2001 From: vikas-jamdar Date: Fri, 1 Jun 2018 01:25:54 +0530 Subject: [PATCH 1/3] Updated Happy Base framework to the latest version of Bigtable 0.29.0 --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 4236cfd..ce993ff 100644 --- a/setup.py +++ b/setup.py @@ -51,14 +51,14 @@ REQUIREMENTS = [ - 'google-cloud-bigtable >= 0.26.0, < 0.27dev', + 'google-cloud-bigtable >= 0.29.0', ] SETUP_BASE.pop('url') setup( name='google-cloud-happybase', - version='0.26.0', + version='0.29.0', description='Client library for Google Cloud Bigtable: HappyBase layer', long_description=README, url='https://github.com/GoogleCloudPlatform/google-cloud-python-happybase', From d69511ab2486d63578ab349ef89524ea8d445c8b Mon Sep 17 00:00:00 2001 From: vikas-jamdar Date: Mon, 4 Jun 2018 09:00:30 +0530 Subject: [PATCH 2/3] adding correct condition for bigtable version google-cloud-bigtable >= 0.29.0, < 0.30dev --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index ce993ff..235d1d5 100644 --- a/setup.py +++ b/setup.py @@ -51,14 +51,14 @@ REQUIREMENTS = [ - 'google-cloud-bigtable >= 0.29.0', + 'google-cloud-bigtable >= 0.29.0, < 0.30dev', ] SETUP_BASE.pop('url') setup( name='google-cloud-happybase', - version='0.29.0', + version='0.26.0', description='Client library for Google Cloud Bigtable: HappyBase layer', long_description=README, url='https://github.com/GoogleCloudPlatform/google-cloud-python-happybase', From 73ce580470fd6b2ef7d3364e8b51963710b3c62e Mon Sep 17 00:00:00 2001 From: vikas-jamdar Date: Wed, 6 Jun 2018 02:09:50 +0530 Subject: [PATCH 3/3] datetime timestamp removed. Time will be an integer in microseconds --- unit_tests/test_table.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/unit_tests/test_table.py b/unit_tests/test_table.py index a59a863..547983e 100644 --- a/unit_tests/test_table.py +++ b/unit_tests/test_table.py @@ -1163,26 +1163,25 @@ def test_without_timestamp(self): from google.cloud.bigtable.row_data import Cell value1 = 'foo' - cell1 = Cell(value=value1, timestamp=None) + cell1 = Cell(value=value1, timestamp_micros=None) value2 = 'bar' - cell2 = Cell(value=value2, timestamp=None) + cell2 = Cell(value=value2, timestamp_micros=None) result = self._callFUT([cell1, cell2]) self.assertEqual(result, [value1, value2]) def test_with_timestamp(self): - from google.cloud._helpers import _datetime_from_microseconds from google.cloud.bigtable.row_data import Cell value1 = 'foo' ts1_millis = 1221934570148 - ts1 = _datetime_from_microseconds(ts1_millis * 1000) - cell1 = Cell(value=value1, timestamp=ts1) + ts1 = ts1_millis * 1000 + cell1 = Cell(value=value1, timestamp_micros=ts1) value2 = 'bar' ts2_millis = 1221955575548 - ts2 = _datetime_from_microseconds(ts2_millis * 1000) - cell2 = Cell(value=value2, timestamp=ts2) + ts2 = ts2_millis * 1000 + cell2 = Cell(value=value2, timestamp_micros=ts2) result = self._callFUT([cell1, cell2], include_timestamp=True) self.assertEqual(result, @@ -1215,17 +1214,16 @@ def test_without_timestamp(self): self.assertEqual(result, expected_result) def test_with_timestamp(self): - from google.cloud._helpers import _datetime_from_microseconds from google.cloud.bigtable.row_data import Cell from google.cloud.bigtable.row_data import PartialRowData row_data = PartialRowData(b'row-key') val1 = b'hi-im-bytes' ts1_millis = 1221934570148 - ts1 = _datetime_from_microseconds(ts1_millis * 1000) + ts1 = ts1_millis * 1000 val2 = b'bi-im-hytes' ts2_millis = 1331934880000 - ts2 = _datetime_from_microseconds(ts2_millis * 1000) + ts2 = ts2_millis * 1000 row_data._cells[u'fam1'] = { b'col1': [Cell(val1, ts1)], b'col2': [Cell(val2, ts2)],