adk-docs
adk-docs copied to clipboard
fix(docs): Update bigquery.py creds
I required this to make it work application_default_credentials, _ = google.auth.default()
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.
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.