Skip to content

Conversation

@lipinski
Copy link
Contributor

@lipinski lipinski commented Dec 2, 2025

…tics

Problem: The BigQueryAgentAnalyticsPlugin initializes the bigquery.Client without a specific location, causing it to default to "US".

This behavior breaks functionality for users in organizations with strict Organization Policies (constraints) that forbid creating or accessing resources in the "US" multi-region. When the plugin attempts to connect to "US", it fails due to Data Residency or Organization Policy restrictions.

Solution: I updated the _ensure_init method to pass the location=self._location argument when initializing bigquery.Client.

This allows the user to specify a compliant region (e.g., europe-west1) in the plugin constructor, ensuring the underlying client respects the location constraint and avoids policy violations.

Testing Plan
Unit Tests:
[ ] I have added or updated unit tests for my change.
[x] All unit tests pass locally.

Ran existing suite via pytest. No regressions found.

Manual End-to-End (E2E) Tests:
To verify this fix, I performed the following manual test:
Created a BigQuery Dataset in a non-US region (e.g., europe-west1).
Initialized the BigQueryAgentAnalyticsPlugin with location="europe-west1".
Verified that the plugin successfully connected and created/accessed the table without raising a "Not Found" or location error.

Checklist
[x] I have read the CONTRIBUTING.md document.
[x] I have performed a self-review of my own code.
[ ] I have commented my code, particularly in hard-to-understand areas.
[ ] I have added tests that prove my fix is effective or that my feature works.
[x] New and existing unit tests pass locally with my changes.
[x] I have manually tested my changes end-to-end.
[ ] Any dependent changes have been merged and published in downstream modules.

@adk-bot
Copy link
Collaborator

adk-bot commented Dec 2, 2025

Response from ADK Triaging Agent

Hello @lipinski, thank you for creating this PR!

To help us review your contribution, could you please fill out the PR template? Specifically, we need:

  • Link to Issue or Description of Change: Please either link to an existing issue or describe the problem and solution in the PR description.
  • Testing Plan: Please describe the unit tests or manual end-to-end tests you performed to verify your changes.

This information is crucial for our review process as outlined in our contribution guidelines. Thanks!

@adk-bot adk-bot added the tools [Component] This issue is related to tools label Dec 2, 2025
@lipinski lipinski marked this pull request as ready for review December 2, 2025 13:24
@xuanyang15 xuanyang15 self-assigned this Dec 2, 2025
copybara-service bot pushed a commit that referenced this pull request Dec 4, 2025
…nalytics

Merge #3784

Co-authored-by: Xuan Yang <xygoogle@google.com>
COPYBARA_INTEGRATE_REVIEW=#3784 from lipinski:fix/add-location-to-bigqueryagentanalytics 8d88b2c
PiperOrigin-RevId: 839980070
@adk-bot
Copy link
Collaborator

adk-bot commented Dec 4, 2025

Thank you @lipinski for your contribution! 🎉

Your changes have been successfully imported and merged via Copybara in commit 507424a.

Closing this PR as the changes are now in the main branch.

@adk-bot adk-bot closed this Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tools [Component] This issue is related to tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants