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

setting GOOGLE_APPLICATION_CREDENTIALS break bigquery #1309

Open
flapili opened this issue Nov 9, 2023 · 0 comments
Open

setting GOOGLE_APPLICATION_CREDENTIALS break bigquery #1309

flapili opened this issue Nov 9, 2023 · 0 comments
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

@flapili
Copy link

flapili commented Nov 9, 2023

Hi,

settings GOOGLE_APPLICATION_CREDENTIALS totally break bigquery

Environment details

  • OS: macos somona
  • Node.js version: 18.18.2 via nvm
  • npm version: pnpm8.10.2
  • @google-cloud/bigquery version: 7.3.0

Steps to reproduce

import process from "node:process";
import { BigQuery } from "@google-cloud/bigquery"

const path = "./project-id-123456789.json"

async function listDatasets(client) {
    const [datasets] = await client.getDatasets();
    console.log(`Datasets:\n${datasets.map((dataset) => ` - ${dataset.id}`).join("\n")}\n`);
}
// work, return the datasets
await listDatasets(new BigQuery({
    projectId: "foobar",
    keyFile: path,
}))

// doesn't work, but doesn't throw any error, just return empty list
process.env.GOOGLE_APPLICATION_CREDENTIALS = path
await listDatasets(new BigQuery())

// doesn't work anymore 
await listDatasets(new BigQuery({
    projectId: "foobar",
    keyFile: path,
}))
@flapili flapili 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 Nov 9, 2023
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/nodejs-bigquery API. label Nov 9, 2023
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

1 participant