Dataset {
_events: [Object: null prototype] {},
_eventsCount: 0,
_maxListeners: undefined,
metadata: {
kind: 'bigquery#dataset',
id: 'bigquery-public-data:austin_311',
datasetReference: { datasetId: 'austin_311', projectId: 'bigquery-public-data' },
location: 'US'
},
baseUrl: '/datasets',
parent: BigQuery {
baseUrl: 'https://bigquery.googleapis.com/bigquery/v2',
apiEndpoint: 'https://bigquery.googleapis.com',
timeout: undefined,
globalInterceptors: [],
interceptors: [ [Object] ],
packageJson: {
name: '@google-cloud/bigquery',
description: 'Google BigQuery Client Library for Node.js',
version: '6.0.0',
license: 'Apache-2.0',
author: 'Google LLC',
engines: [Object],
repository: 'googleapis/nodejs-bigquery',
main: './build/src/index.js',
types: './build/src/index.d.ts',
files: [Array],
keywords: [Array],
scripts: [Object],
dependencies: [Object],
devDependencies: [Object]
},
projectId: 'foo',
projectIdRequired: true,
providedUserAgent: undefined,
makeAuthenticatedRequest: [Function: makeAuthenticatedRequest] {
getCredentials: [Function: bound getCredentials],
authClient: [GoogleAuth]
},
authClient: GoogleAuth {
checkIsGCE: undefined,
jsonContent: [Object],
cachedCredential: [JWT],
_cachedProjectId: 'sql-app-146706',
keyFilename: undefined,
scopes: [Array],
clientOptions: undefined
},
getCredentials: [Function: bound getCredentials],
location: undefined,
createQueryStream: [Function (anonymous)],
getDatasetsStream: [Function (anonymous)],
getJobsStream: [Function (anonymous)]
},
id: 'austin_311',
createMethod: [Function: createMethod],
methods: {
create: true,
exists: true,
get: true,
getMetadata: true,
setMetadata: true
},
interceptors: [ { request: [Function: request] } ],
pollIntervalMs: undefined,
projectId: undefined,
location: 'US',
bigQuery: BigQuery {
baseUrl: 'https://bigquery.googleapis.com/bigquery/v2',
apiEndpoint: 'https://bigquery.googleapis.com',
timeout: undefined,
globalInterceptors: [],
interceptors: [ [Object] ],
packageJson: {
name: '@google-cloud/bigquery',
description: 'Google BigQuery Client Library for Node.js',
version: '6.0.0',
license: 'Apache-2.0',
author: 'Google LLC',
engines: [Object],
repository: 'googleapis/nodejs-bigquery',
main: './build/src/index.js',
types: './build/src/index.d.ts',
files: [Array],
keywords: [Array],
scripts: [Object],
dependencies: [Object],
devDependencies: [Object]
},
projectId: 'foo',
projectIdRequired: true,
providedUserAgent: undefined,
makeAuthenticatedRequest: [Function: makeAuthenticatedRequest] {
getCredentials: [Function: bound getCredentials],
authClient: [GoogleAuth]
},
authClient: GoogleAuth {
checkIsGCE: undefined,
jsonContent: [Object],
cachedCredential: [JWT],
_cachedProjectId: 'foo',
keyFilename: undefined,
scopes: [Array],
clientOptions: undefined
},
getCredentials: [Function: bound getCredentials],
location: undefined,
createQueryStream: [Function (anonymous)],
getDatasetsStream: [Function (anonymous)],
getJobsStream: [Function (anonymous)]
},
getModelsStream: [Function (anonymous)],
getRoutinesStream: [Function (anonymous)],
getTablesStream: [Function (anonymous)],
[Symbol(kCapture)]: false
}
Environment details
@google-cloud/bigqueryversion: 6.0.0Steps to reproduce
This will throw an error when I run
getTableswith messageApiError: Not found: Dataset foo:austin_311. To get this to work, I need to passprojectIdto every method call, be it for fetching tables, routines, metadata, etc. This was surprising to me and coworkers where we had assumed that the methods would use the object'sprojectIdversus the overall client. The console log on the dataset gives me:So the correct projectId is recorded as part of
dataset.metadata.idand indataset.metadata.datasetReference.projectId, but I'm guessing that that for the API calls, it usesdataset.bigQuery.projectIdor something which is different.