Skip to content

Commit 4010716

Browse files
wuliang229copybara-github
authored andcommitted
fix(bigquery): use valid dataplex OAuth scope
Closes issue #4805 Co-authored-by: Liang Wu <wuliang@google.com> PiperOrigin-RevId: 883403628
1 parent b24f604 commit 4010716

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/google/adk/tools/bigquery/bigquery_credentials.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
BIGQUERY_TOKEN_CACHE_KEY = "bigquery_token_cache"
2222
BIGQUERY_SCOPES = [
2323
"https://www.googleapis.com/auth/bigquery",
24-
"https://www.googleapis.com/auth/dataplex",
24+
"https://www.googleapis.com/auth/dataplex.read-write",
2525
]
2626
BIGQUERY_DEFAULT_SCOPE = ["https://www.googleapis.com/auth/bigquery"]
2727

tests/unittests/tools/bigquery/test_bigquery_credentials.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def test_valid_credentials_object_auth_credentials(self):
4747
assert config.client_secret is None
4848
assert config.scopes == [
4949
"https://www.googleapis.com/auth/bigquery",
50-
"https://www.googleapis.com/auth/dataplex",
50+
"https://www.googleapis.com/auth/dataplex.read-write",
5151
]
5252

5353
def test_valid_credentials_object_oauth2_credentials(self):
@@ -90,7 +90,7 @@ def test_valid_client_id_secret_pair_default_scope(self):
9090
assert config.client_secret == "test_client_secret"
9191
assert config.scopes == [
9292
"https://www.googleapis.com/auth/bigquery",
93-
"https://www.googleapis.com/auth/dataplex",
93+
"https://www.googleapis.com/auth/dataplex.read-write",
9494
]
9595

9696
def test_valid_client_id_secret_pair_w_scope(self):
@@ -135,7 +135,7 @@ def test_valid_client_id_secret_pair_w_empty_scope(self):
135135
assert config.client_secret == "test_client_secret"
136136
assert config.scopes == [
137137
"https://www.googleapis.com/auth/bigquery",
138-
"https://www.googleapis.com/auth/dataplex",
138+
"https://www.googleapis.com/auth/dataplex.read-write",
139139
]
140140

141141
def test_missing_client_secret_raises_error(self):

0 commit comments

Comments
 (0)