Skip to content

Commit

Permalink
chore(testproxy): update the proxy proto and code accordingly (#1271)
Browse files Browse the repository at this point in the history
  • Loading branch information
liujiongxin authored May 8, 2023
1 parent e60e3d8 commit 436e778
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions protos/test_proxy.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions testproxy/services/bulk-mutate-rows.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,21 @@ const bulkMutateRows = ({clientMap}) =>
await table.mutate(entries, mutateOptions);
return {
status: {code: grpc.status.OK, details: []},
entry: [],
entries: [],
};
} catch (error) {
if (error.name === 'PartialFailureError') {
return {
status: error,
entry: Array.from(error.errors.entries()).map(([index, entry]) => ({
entries: Array.from(error.errors.entries()).map(([index, entry]) => ({
index: index + 1,
status: entry,
})),
};
} else {
return {
status: error,
entry: [],
entries: [],
};
}
}
Expand Down
2 changes: 1 addition & 1 deletion testproxy/services/read-rows.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const readRows = ({clientMap}) =>
const [rows] = await table.getRows(rowsOptions);
return {
status: {code: grpc.status.OK, details: []},
row: rows.map(getRowResponse),
rows: rows.map(getRowResponse),
};
} catch (e) {
return {status: e};
Expand Down
4 changes: 2 additions & 2 deletions testproxy/services/sample-row-keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const sampleRowKeys = ({clientMap}) =>

const {clientId} = request;
const client = clientMap.get(clientId)[v2];
const sample = await new Promise((res, rej) => {
const samples = await new Promise((res, rej) => {
const response = [];
client
.sampleRowKeys({
Expand All @@ -43,7 +43,7 @@ const sampleRowKeys = ({clientMap}) =>

return {
status: {code: grpc.status.OK, details: []},
sample,
samples,
};
});

Expand Down

0 comments on commit 436e778

Please sign in to comment.