adk-docs icon indicating copy to clipboard operation
adk-docs copied to clipboard

fix(docs): Update bigquery.py creds

Open zeroasterisk opened this issue 1 month ago • 2 comments

I required this to make it work application_default_credentials, _ = google.auth.default()

zeroasterisk avatar Oct 31 '25 20:10 zeroasterisk

We actually just changed this in https://github.com/google/adk-docs/pull/825 to do the inverse since this pattern of using google.auth.default() within the tool couples the auth lifecycle to the agent's tool lifecycle and leads to unexpected token expirations. Using the currently documented approach, did you obtain ADC before running the code sample?

Pinging @slilichenko for guidance / clarification on this PR.

koverholt avatar Oct 31 '25 20:10 koverholt

The code sample you provided has a subtle bug. It works for a short period of time, and then the auth token will expire and the calls will start failing. Not providing the credentials at all will cause the BigQuery API to fall back on getting the credentials using ADC every time.

slilichenko avatar Nov 03 '25 16:11 slilichenko