Skip to content
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
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ Stephen Sawchuk <[email protected]>
Tim Swast <[email protected]>
Zach Bjornson <[email protected]>
c0b <[email protected]>
greenkeeper[bot] <greenkeeper[bot]@users.noreply.github.com>
swftvsn <[email protected]>
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"Tim Swast <[email protected]>",
"Zach Bjornson <[email protected]>",
"c0b <[email protected]>",
"greenkeeper[bot] <greenkeeper[bot]@users.noreply.github.com>",
"swftvsn <[email protected]>"
],
"scripts": {
Expand All @@ -70,7 +71,7 @@
"uuid": "^3.1.0"
},
"devDependencies": {
"@google-cloud/nodejs-repo-tools": "^2.1.2",
"@google-cloud/nodejs-repo-tools": "^2.1.3",
"@google-cloud/storage": "*",
"async": "^2.6.0",
"codecov": "^3.0.0",
Expand Down
6 changes: 3 additions & 3 deletions samples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
},
"dependencies": {
"@google-cloud/bigquery": "0.11.1",
"@google-cloud/storage": "1.4.0",
"@google-cloud/storage": "1.5.1",
"yargs": "10.0.3"
},
"devDependencies": {
"@google-cloud/nodejs-repo-tools": "2.1.3",
"ava": "0.23.0",
"ava": "0.24.0",
"nyc": "11.3.0",
"proxyquire": "1.8.0",
"sinon": "4.1.2",
"sinon": "4.1.3",
"uuid": "3.1.0"
}
}
7 changes: 1 addition & 6 deletions samples/system-test/tables.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,7 @@ test.serial(`should insert rows`, async t => {
)}'`,
cwd
);
t.is(
output.includes(
`Inserted:\n{ Name: 'foo', Age: 27, Weight: 80.3, IsMagic: true }\n{ Name: 'bar', Age: 13, Weight: 54.6, IsMagic: false }`
),
true
);
t.is(output.includes(`Inserted 2 rows`), true);
await tools
.tryTest(async assert => {
const [rows] = await bigquery
Expand Down
19 changes: 10 additions & 9 deletions samples/tables.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,17 +387,18 @@ function insertRowsAsStream(datasetId, tableId, rows, projectId) {
.dataset(datasetId)
.table(tableId)
.insert(rows)
.then(insertErrors => {
console.log('Inserted:');
rows.forEach(row => console.log(row));

if (insertErrors && insertErrors.length > 0) {
console.log('Insert errors:');
insertErrors.forEach(err => console.error(err));
}
.then(() => {
console.log(`Inserted ${rows.length} rows`);
})
.catch(err => {
console.error('ERROR:', err);
if (err && err.name === 'PartialFailureError') {
if (err.errors && err.errors.length > 0) {
console.log('Insert errors:');
err.errors.forEach(err => console.error(err));
}
} else {
console.error('ERROR:', err);
}
});
// [END bigquery_insert_stream]
}
Expand Down