From bdb0a8990cf07cf99971100082b3c428a4540abe Mon Sep 17 00:00:00 2001 From: George Date: Mon, 16 Sep 2019 23:31:33 +0900 Subject: [PATCH] update obsolete method for BigQuery Thank you for providing nice tutorials. This is quickest proposal to make it work with latest client library. - Line 339: `table.import(...)` doesn't work and need to use `table.load(...)` instead. - Line 341: `job` doesn't have `promise()` --- functions/sendgrid/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/sendgrid/index.js b/functions/sendgrid/index.js index a5ff238778..978b88b811 100644 --- a/functions/sendgrid/index.js +++ b/functions/sendgrid/index.js @@ -336,9 +336,9 @@ exports.sendgridLoad = event => { autodetect: true, sourceFormat: 'NEWLINE_DELIMITED_JSON', }; - return table.import(fileObj, metadata); + return table.load(fileObj, metadata); }) - .then(([job]) => job.promise()) + .then(([job]) => job) .then(() => console.log(`Job complete for ${file.name}`)) .catch(err => { console.log(`Job failed for ${file.name}`);