| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c6d953b commit 1dcb95f
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -582,6 +582,7 @@ def commit(self): | |||
| 582 | 582 | table_name=self._table.name, | |
| 583 | 583 | row_key=self._row_key, | |
| 584 | 584 | predicate_filter=self._filter.to_pb(), | |
| 585 | + app_profile_id=self._table._app_profile_id, | ||
| 585 | 586 | true_mutations=true_mutations, | |
| 586 | 587 | false_mutations=false_mutations, | |
| 587 | 588 | ) | |
@@ -908,7 +909,10 @@ def commit(self): | |||
| 908 | 909 | ||
| 909 | 910 | data_client = self._table._instance._client.table_data_client | |
| 910 | 911 | row_response = data_client.read_modify_write_row( | |
| 911 | - table_name=self._table.name, row_key=self._row_key, rules=self._rule_pb_list | ||
| 912 | + table_name=self._table.name, | ||
| 913 | + row_key=self._row_key, | ||
| 914 | + rules=self._rule_pb_list, | ||
| 915 | + app_profile_id=self._table._app_profile_id, | ||
| 912 | 916 | ) | |
| 913 | 917 | ||
| 914 | 918 | # Reset modifications after commit-ing request. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -409,6 +409,7 @@ def test_commit(self): | |||
| 409 | 409 | project_id = "project-id" | |
| 410 | 410 | row_key = b"row_key" | |
| 411 | 411 | table_name = "projects/more-stuff" | |
| 412 | + app_profile_id = "app_profile_id" | ||
| 412 | 413 | column_family_id1 = u"column_family_id1" | |
| 413 | 414 | column_family_id2 = u"column_family_id2" | |
| 414 | 415 | column_family_id3 = u"column_family_id3" | |
@@ -420,7 +421,7 @@ def test_commit(self): | |||
| 420 | 421 | client = self._make_client( | |
| 421 | 422 | project=project_id, credentials=credentials, admin=True | |
| 422 | 423 | ) | |
| 423 | - table = _Table(table_name, client=client) | ||
| 424 | + table = _Table(table_name, client=client, app_profile_id=app_profile_id) | ||
| 424 | 425 | row_filter = RowSampleFilter(0.33) | |
| 425 | 426 | row = self._make_one(row_key, table, filter_=row_filter) | |
| 426 | 427 | ||
@@ -444,6 +445,8 @@ def test_commit(self): | |||
| 444 | 445 | row.delete_cell(column_family_id2, column2, state=True) | |
| 445 | 446 | row.delete_cells(column_family_id3, row.ALL_COLUMNS, state=True) | |
| 446 | 447 | result = row.commit() | |
| 448 | + call_args = api.transport.check_and_mutate_row.call_args.args[0] | ||
| 449 | + self.assertEqual(app_profile_id, call_args.app_profile_id) | ||
| 447 | 450 | self.assertEqual(result, expected_result) | |
| 448 | 451 | self.assertEqual(row._true_pb_mutations, []) | |
| 449 | 452 | self.assertEqual(row._false_pb_mutations, []) | |
@@ -564,6 +567,7 @@ def test_commit(self): | |||
| 564 | 567 | project_id = "project-id" | |
| 565 | 568 | row_key = b"row_key" | |
| 566 | 569 | table_name = "projects/more-stuff" | |
| 570 | + app_profile_id = "app_profile_id" | ||
| 567 | 571 | column_family_id = u"column_family_id" | |
| 568 | 572 | column = b"column" | |
| 569 | 573 | ||
@@ -572,7 +576,7 @@ def test_commit(self): | |||
| 572 | 576 | client = self._make_client( | |
| 573 | 577 | project=project_id, credentials=credentials, admin=True | |
| 574 | 578 | ) | |
| 575 | - table = _Table(table_name, client=client) | ||
| 579 | + table = _Table(table_name, client=client, app_profile_id=app_profile_id) | ||
| 576 | 580 | row = self._make_one(row_key, table) | |
| 577 | 581 | ||
| 578 | 582 | # Create request_pb | |
@@ -593,7 +597,8 @@ def mock_parse_rmw_row_response(row_response): | |||
| 593 | 597 | with _Monkey(MUT, _parse_rmw_row_response=mock_parse_rmw_row_response): | |
| 594 | 598 | row.append_cell_value(column_family_id, column, value) | |
| 595 | 599 | result = row.commit() | |
| 596 | - | ||
| 600 | + call_args = api.transport.read_modify_write_row.call_args.args[0] | ||
| 601 | + self.assertEqual(app_profile_id, call_args.app_profile_id) | ||
| 597 | 602 | self.assertEqual(result, expected_result) | |
| 598 | 603 | self.assertEqual(row._rule_pb_list, []) | |
| 599 | 604 | ||
@@ -819,9 +824,10 @@ def __init__(self, client=None): | |||
| 819 | 824 | ||
| 820 | 825 | ||
| 821 | 826 | class _Table(object): | |
| 822 | - def __init__(self, name, client=None): | ||
| 827 | + def __init__(self, name, client=None, app_profile_id=None): | ||
| 823 | 828 | self.name = name | |
| 824 | 829 | self._instance = _Instance(client) | |
| 830 | + self._app_profile_id = app_profile_id | ||
| 825 | 831 | self.client = client | |
| 826 | 832 | self.mutated_rows = [] | |
| 827 | 833 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments