nodejs-bigquery icon indicating copy to clipboard operation
nodejs-bigquery copied to clipboard

GetRowsOptions Type Error for startIndex: Expects a string when it should expect a number

Open arjunmehta opened this issue 10 months ago • 5 comments

Environment details

  • OS: macOS 14.4.1
  • Node.js version: 20.11
  • npm version: 10.2.4
  • @google-cloud/bigquery version: 7.5.2

Steps to reproduce

  1. Try to pass startIndex as an integer option to getRows. eg.table.getRows({ startIndex: 31241 }).
  2. Observe typescript error. Expects a string when this should be a number.
  3. Passing a number in as "string" allows it to compile.

Expected behaviour

startIndex should work with an integer. As it is right now I need to convert the integer to a string eg. 31241.toString()

Relevant fixes in the code

https://github.com/googleapis/nodejs-bigquery/blob/74aa1501452c36af7969bb4a46b996485d9ca91b/src/types.d.ts#L5903 https://github.com/googleapis/nodejs-bigquery/blob/74aa1501452c36af7969bb4a46b996485d9ca91b/src/types.d.ts#L6055

arjunmehta avatar Apr 02 '24 22:04 arjunmehta