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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build!: update library to use Node 12 #1114

Merged
merged 5 commits into from
May 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/sync-repo-settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ branchProtectionRules:
- "ci/kokoro: System test"
- docs
- lint
- test (10)
- test (12)
- test (14)
- test (16)
- cla/google
- windows
- OwlBot Post Processor
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [10, 12, 14]
node: [12, 14, 16]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down
34 changes: 0 additions & 34 deletions .kokoro/continuous/node10/common.cfg

This file was deleted.

4 changes: 0 additions & 4 deletions .kokoro/continuous/node10/docs.cfg

This file was deleted.

9 changes: 0 additions & 9 deletions .kokoro/continuous/node10/test.cfg

This file was deleted.

24 changes: 0 additions & 24 deletions .kokoro/continuous/node8/common.cfg

This file was deleted.

Empty file.
34 changes: 0 additions & 34 deletions .kokoro/presubmit/node10/common.cfg

This file was deleted.

4 changes: 0 additions & 4 deletions .kokoro/presubmit/node10/docs.cfg

This file was deleted.

4 changes: 0 additions & 4 deletions .kokoro/presubmit/node10/lint.cfg

This file was deleted.

Empty file.
24 changes: 0 additions & 24 deletions .kokoro/presubmit/node8/common.cfg

This file was deleted.

Empty file removed .kokoro/presubmit/node8/test.cfg
Empty file.
2 changes: 1 addition & 1 deletion benchmark/bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Promise.all(
).catch(console.error);

async function doQuery(queryTxt: string) {
return new Promise((resolve, reject) => {
return new Promise<void>((resolve, reject) => {
const startMilli = new Date().getTime();
let numRows = 0;
let numCols: number;
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "Apache-2.0",
"author": "Google LLC",
"engines": {
"node": ">=10"
"node": ">=12.0.0"
},
"repository": "googleapis/nodejs-bigquery",
"main": "./build/src/index.js",
Expand Down Expand Up @@ -79,17 +79,17 @@
"codecov": "^3.5.0",
"discovery-tsd": "^0.3.0",
"execa": "^5.0.0",
"gts": "^3.0.0",
"gts": "^3.1.0",
"jsdoc": "^3.6.3",
"jsdoc-fresh": "^1.0.1",
"jsdoc-region-tag": "^1.0.2",
"linkinator": "^2.0.0",
"mocha": "^8.0.0",
"mocha": "^9.2.2",
"mv": "^2.1.1",
"ncp": "^2.0.0",
"proxyquire": "^2.1.0",
"sinon": "^14.0.0",
"tmp": "0.2.1",
"typescript": "^3.8.3"
"typescript": "^4.6.4"
}
}
4 changes: 2 additions & 2 deletions samples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"author": "Google LLC",
"repository": "googleapis/nodejs-bigquery",
"engines": {
"node": ">=8"
"node": ">=12.0.0"
},
"scripts": {
"test": "mocha --timeout 200000"
Expand All @@ -30,4 +30,4 @@
"sinon": "^14.0.0",
"uuid": "^8.0.0"
}
}
}
4 changes: 3 additions & 1 deletion src/bigquery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2240,7 +2240,9 @@ export class BigQueryInt extends Number {
try {
return this.typeCastFunction!(this.value);
} catch (error) {
error.message = `integerTypeCastFunction threw an error:\n\n - ${error.message}`;
(error as Error).message = `integerTypeCastFunction threw an error:\n\n - ${
(error as Error).message
}`;
throw error;
}
} else {
Expand Down
6 changes: 3 additions & 3 deletions src/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2118,16 +2118,16 @@ class Table extends ServiceObject {
options: InsertRowsOptions
): Promise<bigquery.ITableDataInsertAllResponse> {
const {partialRetries = 3} = options;
let error: Error;
let error: GoogleErrorBody;

const maxAttempts = Math.max(partialRetries, 0) + 1;

for (let attempts = 0; attempts < maxAttempts; attempts++) {
try {
return await this._insert(rows, options);
} catch (e) {
error = e;
rows = ((e.errors || []) as PartialInsertFailure[])
error = e as GoogleErrorBody;
rows = (((e as GoogleErrorBody).errors || []) as PartialInsertFailure[])
.filter(err => !!err.row)
.map(err => err.row);

Expand Down
12 changes: 11 additions & 1 deletion test/bigquery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ class FakeApiError {
}
}

interface InputObject {
year?: number;
month?: number;
day?: number;
hours?: number;
minutes?: number;
seconds?: number;
fractional?: number;
}

interface CalledWithService extends Service {
calledWith_: Array<{
baseUrl: string;
Expand Down Expand Up @@ -763,7 +773,7 @@ describe('BigQuery', () => {
});

it('should not include fractional digits if not provided', () => {
const input = Object.assign({}, INPUT_OBJ);
const input = Object.assign({}, INPUT_OBJ) as InputObject;
delete input.fractional;

const time = bq.time(input);
Expand Down