Repository navigation
Conversation
| self.name) | ||
| return response_iterator | ||
|
|
||
| def truncate(self, timeout=60): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| delete_all_data_from_table=True, | ||
| timeout=timeout) | ||
|
|
||
| def drop_by_prefix(self, row_key_prefix, timeout=60): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
…into feature/add_truncate_table_and_drop_by_prefix
|
@sduskis Fixed please review |
|
|
||
| result = table.truncate() | ||
|
|
||
| self.assertEqual(result, expected_result) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| self.assertEqual(result, expected_result) | ||
|
|
||
| def test_drop_by_prefix_w_timestamp(self): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| data_api = bigtable_client.BigtableClient(mock.Mock()) | ||
| table_api = bigtable_table_admin_client.BigtableTableAdminClient( | ||
| mock.Mock()) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| data_api = bigtable_client.BigtableClient(mock.Mock()) | ||
| table_api = bigtable_table_admin_client.BigtableTableAdminClient( | ||
| mock.Mock()) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| data_api = bigtable_client.BigtableClient(mock.Mock()) | ||
| table_api = bigtable_table_admin_client.BigtableTableAdminClient( | ||
| mock.Mock()) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
…into feature/add_truncate_table_and_drop_by_prefix
| Config.CLIENT = Client(admin=True, credentials=credentials) | ||
| else: | ||
| Config.CLIENT = Client(admin=True) | ||
| Config.CLIENT = Client(project='grass-clump-479', admin=True) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| row_keys = [ | ||
| 'row_key_1', 'row_key_2', 'row_key_3', 'row_key_4', 'row_key_5', | ||
| 'row_key_pr_1', 'row_key_pr_2', 'row_key_pr_3', 'row_key_pr_4', | ||
| 'row_key_pr_5'] |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| row_keys = [ | ||
| 'row_key_1', 'row_key_2', 'row_key_3', 'row_key_4', 'row_key_5', | ||
| 'row_key_pr_1', 'row_key_pr_2', 'row_key_pr_3', 'row_key_pr_4', | ||
| 'row_key_pr_5'] |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
@tseaver Ready to merge? Thanks. |
|
@aneepct One of the system tests added by this PR is failing on CI this morning 1 2 3 4: ____________________ TestDataAPI.test_drop_by_prefix_table _____________________
self = <tests.system.TestDataAPI testMethod=test_drop_by_prefix_table>
def test_drop_by_prefix_table(self):
row_keys = [
b'row_key_1', b'row_key_2', b'row_key_3', b'row_key_4',
b'row_key_5', b'row_key_pr_1', b'row_key_pr_2', b'row_key_pr_3',
b'row_key_pr_4', b'row_key_pr_5']
for row_key in row_keys:
row = self._table.row(row_key)
row.set_cell(COLUMN_FAMILY_ID1, COL_NAME1, CELL_VAL1)
row.commit()
self.rows_to_delete.append(row)
self._table.drop_by_prefix(row_key_prefix='row_key_pr', timeout=200)
read_rows = self._table.yield_rows()
expected_rows_count = 5
read_rows_count = 0
for row in read_rows:
if row.row_key.decode('utf-8') in row_keys:
read_rows_count += 1
> self.assertEqual(expected_rows_count, read_rows_count)
E AssertionError: 5 != 0 |
Add methods on Table to delete rows by prefix and truncate all rows.