From e1fc0ce9e3d9e10469416c69136c3cadaa3ef604 Mon Sep 17 00:00:00 2001 From: Alvaro Viebrantz Date: Thu, 11 Jul 2024 10:54:39 -0400 Subject: [PATCH 1/3] feat: clean cached rows and responses after convertion --- src/bigquery.ts | 1 + src/job.ts | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/bigquery.ts b/src/bigquery.ts index bc85b18d..9b864143 100644 --- a/src/bigquery.ts +++ b/src/bigquery.ts @@ -2186,6 +2186,7 @@ export class BigQuery extends Service { wrapIntegers: options.wrapIntegers || false, parseJSON: options.parseJSON, }); + delete res.rows; } this.trace_('[runJobsQuery] job complete'); options._cachedRows = rows; diff --git a/src/job.ts b/src/job.ts index 78e6a6d2..04ce0ec2 100644 --- a/src/job.ts +++ b/src/job.ts @@ -565,16 +565,19 @@ class Job extends Operation { const timeoutOverride = typeof qs.timeoutMs === 'number' ? qs.timeoutMs : false; - if (options._cachedRows) { + const cachedRows = options._cachedRows; + const cachedResponse = options._cachedResponse; + delete options._cachedRows; + delete options._cachedResponse; + if (cachedRows) { let nextQuery: QueryResultsOptions | null = null; if (options.pageToken) { nextQuery = Object.assign({}, options, { pageToken: options.pageToken, }); - delete nextQuery._cachedRows; - delete nextQuery._cachedResponse; } - callback!(null, options._cachedRows, nextQuery, options._cachedResponse); + delete cachedResponse?.rows; + callback!(null, cachedRows, nextQuery, cachedResponse); return; } @@ -620,7 +623,7 @@ class Job extends Operation { }); delete nextQuery.startIndex; } - + delete resp.rows; callback!(null, rows, nextQuery, resp); } ); From 26a97986e864cb6d6f0c3a69ef0eb728cd03cd19 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 11 Jul 2024 18:59:38 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- src/types.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/types.d.ts b/src/types.d.ts index 2114c169..d64bb052 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Discovery Revision: 20240623 + * Discovery Revision: 20240629 */ /** @@ -470,7 +470,7 @@ declare namespace bigquery { */ type IBigtableColumnFamily = { /** - * Optional. Lists of columns that should be exposed as individual fields as opposed to a list of (column name, value) pairs. All columns whose qualifier matches a qualifier in this list can be accessed as `.`. Other columns can be accessed as a list through `.Column` field. + * Optional. Lists of columns that should be exposed as individual fields as opposed to a list of (column name, value) pairs. All columns whose qualifier matches a qualifier in this list can be accessed as `.`. Other columns can be accessed as a list through the `.Column` field. */ columns?: Array; /** @@ -878,7 +878,7 @@ declare namespace bigquery { */ iamMember?: string; /** - * An IAM role ID that should be granted to the user, group, or domain specified in this access entry. The following legacy mappings will be applied: * OWNER <=> roles/bigquery.dataOwner * WRITER <=> roles/bigquery.dataEditor * READER <=> roles/bigquery.dataViewer This field will accept any of the above formats, but will return only the legacy format. For example, if you set this field to "roles/bigquery.dataOwner", it will be returned back as "OWNER". + * An IAM role ID that should be granted to the user, group, or domain specified in this access entry. The following legacy mappings will be applied: * `OWNER`: `roles/bigquery.dataOwner` * `WRITER`: `roles/bigquery.dataEditor` * `READER`: `roles/bigquery.dataViewer` This field will accept any of the above formats, but will return only the legacy format. For example, if you set this field to "roles/bigquery.dataOwner", it will be returned back as "OWNER". */ role?: string; /** @@ -886,7 +886,7 @@ declare namespace bigquery { */ routine?: IRoutineReference; /** - * [Pick one] A special group to grant access to. Possible values include: projectOwners: Owners of the enclosing project. projectReaders: Readers of the enclosing project. projectWriters: Writers of the enclosing project. allAuthenticatedUsers: All authenticated BigQuery users. Maps to similarly-named IAM members. + * [Pick one] A special group to grant access to. Possible values include: * projectOwners: Owners of the enclosing project. * projectReaders: Readers of the enclosing project. * projectWriters: Writers of the enclosing project. * allAuthenticatedUsers: All authenticated BigQuery users. Maps to similarly-named IAM members. */ specialGroup?: string; /** From 02a33b40d22e32422bb4cc4241bf7792f7ba2d25 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 29 Jul 2024 20:36:00 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- src/types.d.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/types.d.ts b/src/types.d.ts index d64bb052..788750e6 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Discovery Revision: 20240629 + * Discovery Revision: 20240714 */ /** @@ -858,7 +858,7 @@ declare namespace bigquery { */ type IDataset = { /** - * Optional. An array of objects that define dataset access for one or more entities. You can set this property when inserting or updating a dataset in order to control who is allowed to access the data. If unspecified at dataset creation time, BigQuery adds default dataset access for the following entities: access.specialGroup: projectReaders; access.role: READER; access.specialGroup: projectWriters; access.role: WRITER; access.specialGroup: projectOwners; access.role: OWNER; access.userByEmail: [dataset creator email]; access.role: OWNER; + * Optional. An array of objects that define dataset access for one or more entities. You can set this property when inserting or updating a dataset in order to control who is allowed to access the data. If unspecified at dataset creation time, BigQuery adds default dataset access for the following entities: access.specialGroup: projectReaders; access.role: READER; access.specialGroup: projectWriters; access.role: WRITER; access.specialGroup: projectOwners; access.role: OWNER; access.userByEmail: [dataset creator email]; access.role: OWNER; If you patch a dataset, then this field is overwritten by the patched dataset's access field. To add entities, you must supply the entire existing access array in addition to any new entities that you want to add. */ access?: Array<{ /** @@ -1013,7 +1013,7 @@ declare namespace bigquery { | 'LOGICAL' | 'PHYSICAL'; /** - * Output only. Tags for the Dataset. + * Output only. Tags for the dataset. To provide tags as inputs, use the `resourceTags` field. */ tags?: Array<{ /** @@ -2754,6 +2754,14 @@ declare namespace bigquery { * Output only. Statistics for data-masking. Present only for query and extract jobs. */ dataMaskingStatistics?: IDataMaskingStatistics; + /** + * Output only. Name of edition corresponding to the reservation for this job at the time of this update. + */ + edition?: + | 'RESERVATION_EDITION_UNSPECIFIED' + | 'STANDARD' + | 'ENTERPRISE' + | 'ENTERPRISE_PLUS'; /** * Output only. End time of this job, in milliseconds since the epoch. This field will be present whenever a job is in the DONE state. */