Skip to content

fix: Import iam_credentials_v1 lazily in the sandboxes module. - #7045

Merged
copybara-service[bot] merged 1 commit into
mainfrom
copybara_957219096
Aug 4, 2026
Merged

fix: Import iam_credentials_v1 lazily in the sandboxes module.#7045
copybara-service[bot] merged 1 commit into
mainfrom
copybara_957219096

Conversation

@copybara-service

Copy link
Copy Markdown
Contributor

fix: Import iam_credentials_v1 lazily in the sandboxes module.

Only Sandboxes.generate_access_token() needs google-cloud-iam, but the
import sat at module scope, so importing the sandboxes module at all required
the package. It is now imported inside the method, so
client.agent_engines.sandboxes is usable without google-cloud-iam installed
unless you actually call generate_access_token, which raises the usual
"install google-cloud-aiplatform[agent_engines]" ImportError if the package is
missing.

@copybara-service
copybara-service Bot requested a review from a team as a code owner August 3, 2026 18:01
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. api: vertex-ai Issues related to the googleapis/python-aiplatform API. labels Aug 3, 2026
@copybara-service
copybara-service Bot force-pushed the copybara_957219096 branch 2 times, most recently from 9bde69f to 36cfc23 Compare August 4, 2026 00:34
Only `Sandboxes.generate_access_token()` needs `google-cloud-iam`, but the
import sat at module scope, so importing the sandboxes module at all required
the package. It is now imported inside the method, so
`client.agent_engines.sandboxes` is usable without `google-cloud-iam` installed
unless you actually call `generate_access_token`, which raises the usual
"install google-cloud-aiplatform[agent_engines]" ImportError if the package is
missing.

PiperOrigin-RevId: 958674488
@copybara-service
copybara-service Bot merged commit 2a18bff into main Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: vertex-ai Issues related to the googleapis/python-aiplatform API. google-contributor size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant