Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit 70d41bf

Browse files
committed
tests: more textproxy typing fixes
1 parent 8403753 commit 70d41bf

1 file changed

Lines changed: 13 additions & 18 deletions

File tree

testproxy/services/utils/request/sampleRowKeys.ts

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,37 +12,32 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
import {Bigtable} from '../../../../src';
1516
import * as protos from '../../../protos/protos';
1617

17-
type SRKRequest = protos.google.bigtable.v2.ISampleRowKeysRequest;
18-
type SRKResponse = protos.google.bigtable.v2.ISampleRowKeysResponse;
18+
type ISampleRowKeysRequest = protos.google.bigtable.v2.ISampleRowKeysRequest;
19+
type ISampleRowKeysResponse = protos.google.bigtable.v2.ISampleRowKeysResponse;
1920

2021
/**
2122
* This function will create a request that can be passed into the
2223
* handwritten ßsampleRowKeys method and calls the Gapic layer under the hood.
2324
*
24-
* @param {any} client Bigtable client
25-
* @param {SRKRequest} request The sampleRowKeys request information
25+
* @param {Bigtable} client Bigtable client
26+
* @param {ISampleRowKeysRequest} request The sampleRowKeys request information
2627
* that can be sent to the Gapic layer.
27-
* @returns {Promise<SRKResponse>} A reponse that can be passed into the
28+
* @returns {Promise<ISampleRowKeysResponse>} A reponse that can be passed into the
2829
* sampleRowKeys Gapic layer.
2930
*/
3031
export function getSRKRequest(
31-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
32-
client: any,
33-
request: SRKRequest,
34-
): Promise<SRKResponse> {
32+
client: Bigtable,
33+
request: ISampleRowKeysRequest,
34+
): Promise<ISampleRowKeysResponse> {
3535
const {tableName} = request;
3636

37-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
38-
const getTableInfo = (bigtable: any, tableName: any) => {
39-
const [, , , instanceId, , tableId] = tableName.split('/');
40-
const instance = bigtable.instance(instanceId);
41-
return instance.table(tableId);
42-
};
43-
44-
const table = getTableInfo(client, tableName);
37+
const [, , , instanceId, , tableId] = tableName!.split('/');
38+
const instance = client.instance(instanceId);
39+
const table = instance.table(tableId);
4540
const sampleRowKeysResponse = table.sampleRowKeys();
4641

47-
return sampleRowKeysResponse;
42+
return sampleRowKeysResponse as Promise<ISampleRowKeysResponse>;
4843
}

0 commit comments

Comments
 (0)