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

table.create() does not respect the projectId at the dataset level #1265

Closed
atrbgithub opened this issue Aug 25, 2023 · 2 comments
Closed

table.create() does not respect the projectId at the dataset level #1265

atrbgithub opened this issue Aug 25, 2023 · 2 comments
Assignees
Labels
api: bigquery Issues related to the googleapis/nodejs-bigquery API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@atrbgithub
Copy link

atrbgithub commented Aug 25, 2023

This is very similar to this issue which was raised about createDataset not supporting the supplying of a projectId.

Now that issue has been fixed ( thank you! ), when trying to use that with table.create() you get an error:

value set through a parameter is inconsistent with a value set in the request

For example, lets say we have the following code:

const bigqueryClient = new BigQuery()

let ds = new Dataset(bigqueryClient, "a_test_dataset", {
   projectId: "a-test-project"
 })

// This now works fine
ds.create()

let table = ds.table("a_test_table")

// This produces the error
await table.create()

gcloud config:

$ gcloud config list|grep project
$ project = some-default-project-id

The error thrown is:

ApiError: Value some-default-project-id in content does not agree with value a-test-project. This can happen when a value set through a parameter is inconsistent with a value set in the request.
@atrbgithub atrbgithub added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Aug 25, 2023
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/nodejs-bigquery API. label Aug 25, 2023
@loferris loferris self-assigned this Aug 30, 2023
@alvarowolfx alvarowolfx assigned alvarowolfx and unassigned loferris Jan 16, 2024
@alvarowolfx
Copy link
Contributor

Fixed by #1326

@atrbgithub
Copy link
Author

Brilliant @alvarowolfx , thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/nodejs-bigquery API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

3 participants