Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Pass app_profile_id when building updated request #512

Merged
merged 3 commits into from Feb 24, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions google/cloud/bigtable/row_data.py
Expand Up @@ -453,6 +453,7 @@ def _create_retry_request(self):
req_manager = _ReadRowsRequestManager(
self.request, self.last_scanned_row_key, self._counter
)
print("retry request")
return req_manager.build_updated_request()

def _on_error(self, exc):
Expand Down Expand Up @@ -627,6 +628,7 @@ def build_updated_request(self):
r_kwargs = {
"table_name": self.message.table_name,
"filter": self.message.filter,
"app_profile_id": self.message.app_profile_id,
igorbernstein2 marked this conversation as resolved.
Show resolved Hide resolved
}

if self.message.rows_limit != 0:
Expand Down
10 changes: 8 additions & 2 deletions tests/unit/test_row_data.py
Expand Up @@ -893,7 +893,10 @@ def test_RRRM_build_updated_request(rrrm_data):
row_filter = RowSampleFilter(0.33)
last_scanned_key = b"row_key25"
request = _ReadRowsRequestPB(
filter=row_filter.to_pb(), rows_limit=8, table_name=TABLE_NAME
filter=row_filter.to_pb(),
rows_limit=8,
table_name=TABLE_NAME,
app_profile_id="app-profile-id-1",
)
request.rows.row_ranges.append(row_range1.get_range_kwargs())

Expand All @@ -902,7 +905,10 @@ def test_RRRM_build_updated_request(rrrm_data):
result = request_manager.build_updated_request()

expected_result = _ReadRowsRequestPB(
table_name=TABLE_NAME, filter=row_filter.to_pb(), rows_limit=6
table_name=TABLE_NAME,
igorbernstein2 marked this conversation as resolved.
Show resolved Hide resolved
filter=row_filter.to_pb(),
rows_limit=6,
app_profile_id="app-profile-id-1",
)

row_range1 = types.RowRange(
Expand Down