google-adk 1.2.0__py3-none-any.whl → 1.4.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. google/adk/a2a/__init__.py +13 -0
  2. google/adk/a2a/converters/__init__.py +13 -0
  3. google/adk/a2a/converters/part_converter.py +166 -0
  4. google/adk/agents/invocation_context.py +2 -0
  5. google/adk/agents/llm_agent.py +1 -6
  6. google/adk/agents/run_config.py +11 -0
  7. google/adk/auth/auth_credential.py +5 -0
  8. google/adk/auth/auth_handler.py +22 -96
  9. google/adk/auth/auth_preprocessor.py +3 -3
  10. google/adk/auth/auth_tool.py +46 -0
  11. google/adk/auth/credential_manager.py +265 -0
  12. google/adk/auth/credential_service/__init__.py +13 -0
  13. google/adk/auth/credential_service/base_credential_service.py +75 -0
  14. google/adk/auth/credential_service/in_memory_credential_service.py +64 -0
  15. google/adk/auth/exchanger/__init__.py +23 -0
  16. google/adk/auth/exchanger/base_credential_exchanger.py +57 -0
  17. google/adk/auth/exchanger/credential_exchanger_registry.py +58 -0
  18. google/adk/auth/exchanger/oauth2_credential_exchanger.py +104 -0
  19. google/adk/auth/exchanger/service_account_credential_exchanger.py +104 -0
  20. google/adk/auth/oauth2_credential_util.py +107 -0
  21. google/adk/auth/refresher/__init__.py +21 -0
  22. google/adk/auth/refresher/base_credential_refresher.py +74 -0
  23. google/adk/auth/refresher/credential_refresher_registry.py +59 -0
  24. google/adk/auth/refresher/oauth2_credential_refresher.py +154 -0
  25. google/adk/cli/agent_graph.py +34 -32
  26. google/adk/cli/browser/index.html +2 -2
  27. google/adk/cli/browser/main-JAAWEV7F.js +92 -0
  28. google/adk/cli/browser/polyfills-B6TNHZQ6.js +17 -0
  29. google/adk/cli/cli.py +10 -0
  30. google/adk/cli/cli_deploy.py +80 -21
  31. google/adk/cli/cli_tools_click.py +132 -61
  32. google/adk/cli/fast_api.py +46 -41
  33. google/adk/cli/utils/agent_loader.py +15 -2
  34. google/adk/cli/utils/evals.py +4 -2
  35. google/adk/code_executors/container_code_executor.py +10 -6
  36. google/adk/code_executors/vertex_ai_code_executor.py +8 -2
  37. google/adk/evaluation/_eval_set_results_manager_utils.py +44 -0
  38. google/adk/evaluation/_eval_sets_manager_utils.py +108 -0
  39. google/adk/evaluation/eval_metrics.py +0 -5
  40. google/adk/evaluation/eval_result.py +12 -7
  41. google/adk/evaluation/eval_set_results_manager.py +6 -1
  42. google/adk/evaluation/gcs_eval_set_results_manager.py +121 -0
  43. google/adk/evaluation/gcs_eval_sets_manager.py +196 -0
  44. google/adk/evaluation/local_eval_set_results_manager.py +6 -18
  45. google/adk/evaluation/local_eval_sets_manager.py +27 -78
  46. google/adk/evaluation/response_evaluator.py +5 -5
  47. google/adk/evaluation/trajectory_evaluator.py +9 -6
  48. google/adk/flows/llm_flows/basic.py +9 -0
  49. google/adk/models/anthropic_llm.py +1 -1
  50. google/adk/models/gemini_llm_connection.py +2 -0
  51. google/adk/models/google_llm.py +57 -16
  52. google/adk/models/lite_llm.py +2 -1
  53. google/adk/platform/__init__.py +13 -0
  54. google/adk/platform/internal/__init__.py +15 -0
  55. google/adk/platform/internal/thread.py +30 -0
  56. google/adk/platform/thread.py +31 -0
  57. google/adk/runners.py +8 -2
  58. google/adk/sessions/in_memory_session_service.py +12 -1
  59. google/adk/sessions/vertex_ai_session_service.py +71 -50
  60. google/adk/tools/__init__.py +2 -0
  61. google/adk/tools/_automatic_function_calling_util.py +1 -0
  62. google/adk/tools/_forwarding_artifact_service.py +96 -0
  63. google/adk/tools/_function_parameter_parse_util.py +1 -0
  64. google/adk/tools/agent_tool.py +5 -39
  65. google/adk/tools/application_integration_tool/integration_connector_tool.py +2 -2
  66. google/adk/tools/authenticated_function_tool.py +107 -0
  67. google/adk/tools/base_authenticated_tool.py +107 -0
  68. google/adk/tools/bigquery/bigquery_credentials.py +6 -4
  69. google/adk/tools/bigquery/bigquery_tool.py +22 -9
  70. google/adk/tools/bigquery/bigquery_toolset.py +9 -3
  71. google/adk/tools/bigquery/client.py +7 -3
  72. google/adk/tools/bigquery/config.py +46 -0
  73. google/adk/tools/bigquery/metadata_tool.py +114 -91
  74. google/adk/tools/bigquery/query_tool.py +141 -23
  75. google/adk/tools/google_api_tool/googleapi_to_openapi_converter.py +7 -4
  76. google/adk/tools/google_search_tool.py +0 -1
  77. google/adk/tools/mcp_tool/__init__.py +6 -0
  78. google/adk/tools/mcp_tool/mcp_session_manager.py +271 -149
  79. google/adk/tools/mcp_tool/mcp_tool.py +79 -22
  80. google/adk/tools/mcp_tool/mcp_toolset.py +32 -29
  81. google/adk/tools/openapi_tool/openapi_spec_parser/rest_api_tool.py +3 -3
  82. google/adk/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.py +56 -33
  83. google/adk/tools/retrieval/files_retrieval.py +7 -1
  84. google/adk/tools/url_context_tool.py +61 -0
  85. google/adk/tools/vertex_ai_search_tool.py +13 -2
  86. google/adk/utils/feature_decorator.py +175 -0
  87. google/adk/version.py +2 -2
  88. {google_adk-1.2.0.dist-info → google_adk-1.4.0.dist-info}/METADATA +10 -1
  89. {google_adk-1.2.0.dist-info → google_adk-1.4.0.dist-info}/RECORD +92 -61
  90. google/adk/cli/browser/main-CS5OLUMF.js +0 -91
  91. google/adk/cli/browser/polyfills-FFHMD2TL.js +0 -17
  92. {google_adk-1.2.0.dist-info → google_adk-1.4.0.dist-info}/WHEEL +0 -0
  93. {google_adk-1.2.0.dist-info → google_adk-1.4.0.dist-info}/entry_points.txt +0 -0
  94. {google_adk-1.2.0.dist-info → google_adk-1.4.0.dist-info}/licenses/LICENSE +0 -0
@@ -27,16 +27,18 @@ from google.oauth2.credentials import Credentials
27
27
  from pydantic import BaseModel
28
28
  from pydantic import model_validator
29
29
 
30
- from ...auth import AuthConfig
31
- from ...auth import AuthCredential
32
- from ...auth import AuthCredentialTypes
33
- from ...auth import OAuth2Auth
30
+ from ...auth.auth_credential import AuthCredential
31
+ from ...auth.auth_credential import AuthCredentialTypes
32
+ from ...auth.auth_credential import OAuth2Auth
33
+ from ...auth.auth_tool import AuthConfig
34
+ from ...utils.feature_decorator import experimental
34
35
  from ..tool_context import ToolContext
35
36
 
36
37
  BIGQUERY_TOKEN_CACHE_KEY = "bigquery_token_cache"
37
38
  BIGQUERY_DEFAULT_SCOPE = ["https://www.googleapis.com/auth/bigquery"]
38
39
 
39
40
 
41
+ @experimental
40
42
  class BigQueryCredentialsConfig(BaseModel):
41
43
  """Configuration for Google API tools. (Experimental)"""
42
44
 
@@ -12,6 +12,7 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
+ from __future__ import annotations
15
16
 
16
17
  import inspect
17
18
  from typing import Any
@@ -21,12 +22,15 @@ from typing import Optional
21
22
  from google.oauth2.credentials import Credentials
22
23
  from typing_extensions import override
23
24
 
25
+ from ...utils.feature_decorator import experimental
24
26
  from ..function_tool import FunctionTool
25
27
  from ..tool_context import ToolContext
26
28
  from .bigquery_credentials import BigQueryCredentialsConfig
27
29
  from .bigquery_credentials import BigQueryCredentialsManager
30
+ from .config import BigQueryToolConfig
28
31
 
29
32
 
33
+ @experimental
30
34
  class BigQueryTool(FunctionTool):
31
35
  """GoogleApiTool class for tools that call Google APIs.
32
36
 
@@ -41,21 +45,27 @@ class BigQueryTool(FunctionTool):
41
45
  def __init__(
42
46
  self,
43
47
  func: Callable[..., Any],
44
- credentials: Optional[BigQueryCredentialsConfig] = None,
48
+ *,
49
+ credentials_config: Optional[BigQueryCredentialsConfig] = None,
50
+ bigquery_tool_config: Optional[BigQueryToolConfig] = None,
45
51
  ):
46
52
  """Initialize the Google API tool.
47
53
 
48
54
  Args:
49
55
  func: callable that impelments the tool's logic, can accept one
50
56
  'credential" parameter
51
- credentials: credentials used to call Google API. If None, then we don't
52
- hanlde the auth logic
57
+ credentials_config: credentials config used to call Google API. If None,
58
+ then we don't hanlde the auth logic
53
59
  """
54
60
  super().__init__(func=func)
55
61
  self._ignore_params.append("credentials")
56
- self.credentials_manager = (
57
- BigQueryCredentialsManager(credentials) if credentials else None
62
+ self._ignore_params.append("config")
63
+ self._credentials_manager = (
64
+ BigQueryCredentialsManager(credentials_config)
65
+ if credentials_config
66
+ else None
58
67
  )
68
+ self._tool_config = bigquery_tool_config
59
69
 
60
70
  @override
61
71
  async def run_async(
@@ -69,12 +79,12 @@ class BigQueryTool(FunctionTool):
69
79
  try:
70
80
  # Get valid credentials
71
81
  credentials = (
72
- await self.credentials_manager.get_valid_credentials(tool_context)
73
- if self.credentials_manager
82
+ await self._credentials_manager.get_valid_credentials(tool_context)
83
+ if self._credentials_manager
74
84
  else None
75
85
  )
76
86
 
77
- if credentials is None and self.credentials_manager:
87
+ if credentials is None and self._credentials_manager:
78
88
  # OAuth flow in progress
79
89
  return (
80
90
  "User authorization is required to access Google services for"
@@ -84,7 +94,7 @@ class BigQueryTool(FunctionTool):
84
94
  # Execute the tool's specific logic with valid credentials
85
95
 
86
96
  return await self._run_async_with_credential(
87
- credentials, args, tool_context
97
+ credentials, self._tool_config, args, tool_context
88
98
  )
89
99
 
90
100
  except Exception as ex:
@@ -96,6 +106,7 @@ class BigQueryTool(FunctionTool):
96
106
  async def _run_async_with_credential(
97
107
  self,
98
108
  credentials: Credentials,
109
+ tool_config: BigQueryToolConfig,
99
110
  args: dict[str, Any],
100
111
  tool_context: ToolContext,
101
112
  ) -> Any:
@@ -113,4 +124,6 @@ class BigQueryTool(FunctionTool):
113
124
  signature = inspect.signature(self.func)
114
125
  if "credentials" in signature.parameters:
115
126
  args_to_call["credentials"] = credentials
127
+ if "config" in signature.parameters:
128
+ args_to_call["config"] = tool_config
116
129
  return await super().run_async(args=args_to_call, tool_context=tool_context)
@@ -26,10 +26,13 @@ from . import query_tool
26
26
  from ...tools.base_tool import BaseTool
27
27
  from ...tools.base_toolset import BaseToolset
28
28
  from ...tools.base_toolset import ToolPredicate
29
+ from ...utils.feature_decorator import experimental
29
30
  from .bigquery_credentials import BigQueryCredentialsConfig
30
31
  from .bigquery_tool import BigQueryTool
32
+ from .config import BigQueryToolConfig
31
33
 
32
34
 
35
+ @experimental
33
36
  class BigQueryToolset(BaseToolset):
34
37
  """BigQuery Toolset contains tools for interacting with BigQuery data and metadata."""
35
38
 
@@ -38,9 +41,11 @@ class BigQueryToolset(BaseToolset):
38
41
  *,
39
42
  tool_filter: Optional[Union[ToolPredicate, List[str]]] = None,
40
43
  credentials_config: Optional[BigQueryCredentialsConfig] = None,
44
+ bigquery_tool_config: Optional[BigQueryToolConfig] = None,
41
45
  ):
42
- self._credentials_config = credentials_config
43
46
  self.tool_filter = tool_filter
47
+ self._credentials_config = credentials_config
48
+ self._tool_config = bigquery_tool_config
44
49
 
45
50
  def _is_tool_selected(
46
51
  self, tool: BaseTool, readonly_context: ReadonlyContext
@@ -64,14 +69,15 @@ class BigQueryToolset(BaseToolset):
64
69
  all_tools = [
65
70
  BigQueryTool(
66
71
  func=func,
67
- credentials=self._credentials_config,
72
+ credentials_config=self._credentials_config,
73
+ bigquery_tool_config=self._tool_config,
68
74
  )
69
75
  for func in [
70
76
  metadata_tool.get_dataset_info,
71
77
  metadata_tool.get_table_info,
72
78
  metadata_tool.list_dataset_ids,
73
79
  metadata_tool.list_table_ids,
74
- query_tool.execute_sql,
80
+ query_tool.get_execute_sql(self._tool_config),
75
81
  ]
76
82
  ]
77
83
 
@@ -18,16 +18,20 @@ import google.api_core.client_info
18
18
  from google.cloud import bigquery
19
19
  from google.oauth2.credentials import Credentials
20
20
 
21
- USER_AGENT = "adk-bigquery-tool"
21
+ from ... import version
22
22
 
23
+ USER_AGENT = f"adk-bigquery-tool google-adk/{version.__version__}"
23
24
 
24
- def get_bigquery_client(*, credentials: Credentials) -> bigquery.Client:
25
+
26
+ def get_bigquery_client(
27
+ *, project: str, credentials: Credentials
28
+ ) -> bigquery.Client:
25
29
  """Get a BigQuery client."""
26
30
 
27
31
  client_info = google.api_core.client_info.ClientInfo(user_agent=USER_AGENT)
28
32
 
29
33
  bigquery_client = bigquery.Client(
30
- credentials=credentials, client_info=client_info
34
+ project=project, credentials=credentials, client_info=client_info
31
35
  )
32
36
 
33
37
  return bigquery_client
@@ -0,0 +1,46 @@
1
+ # Copyright 2025 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ from __future__ import annotations
16
+
17
+ from enum import Enum
18
+
19
+ from pydantic import BaseModel
20
+
21
+ from ...utils.feature_decorator import experimental
22
+
23
+
24
+ class WriteMode(Enum):
25
+ """Write mode indicating what levels of write operations are allowed in BigQuery."""
26
+
27
+ BLOCKED = 'blocked'
28
+ """No write operations are allowed.
29
+
30
+ This mode implies that only read (i.e. SELECT query) operations are allowed.
31
+ """
32
+
33
+ ALLOWED = 'allowed'
34
+ """All write operations are allowed."""
35
+
36
+
37
+ @experimental('Config defaults may have breaking change in the future.')
38
+ class BigQueryToolConfig(BaseModel):
39
+ """Configuration for BigQuery tools."""
40
+
41
+ write_mode: WriteMode = WriteMode.BLOCKED
42
+ """Write mode for BigQuery tools.
43
+
44
+ By default, the tool will allow only read operations. This behaviour may
45
+ change in future versions.
46
+ """
@@ -15,7 +15,7 @@
15
15
  from google.cloud import bigquery
16
16
  from google.oauth2.credentials import Credentials
17
17
 
18
- from ...tools.bigquery import client
18
+ from . import client
19
19
 
20
20
 
21
21
  def list_dataset_ids(project_id: str, credentials: Credentials) -> list[str]:
@@ -42,7 +42,9 @@ def list_dataset_ids(project_id: str, credentials: Credentials) -> list[str]:
42
42
  'bbc_news']
43
43
  """
44
44
  try:
45
- bq_client = client.get_bigquery_client(credentials=credentials)
45
+ bq_client = client.get_bigquery_client(
46
+ project=project_id, credentials=credentials
47
+ )
46
48
 
47
49
  datasets = []
48
50
  for dataset in bq_client.list_datasets(project_id):
@@ -69,40 +71,46 @@ def get_dataset_info(
69
71
  dict: Dictionary representing the properties of the dataset.
70
72
 
71
73
  Examples:
72
- >>> get_dataset_info("bigquery-public-data", "penguins")
74
+ >>> get_dataset_info("bigquery-public-data", "cdc_places")
73
75
  {
74
76
  "kind": "bigquery#dataset",
75
- "etag": "PNC5907iQbzeVcAru/2L3A==",
76
- "id": "bigquery-public-data:ml_datasets",
77
- "selfLink":
78
- "https://bigquery.googleapis.com/bigquery/v2/projects/bigquery-public-data/datasets/ml_datasets",
77
+ "etag": "fz9BaiXKgbGi53EpI2rJug==",
78
+ "id": "bigquery-public-data:cdc_places",
79
+ "selfLink": "https://content-bigquery.googleapis.com/bigquery/v2/projects/bigquery-public-data/datasets/cdc_places",
79
80
  "datasetReference": {
80
- "datasetId": "ml_datasets",
81
- "projectId": "bigquery-public-data"
81
+ "datasetId": "cdc_places",
82
+ "projectId": "bigquery-public-data"
82
83
  },
84
+ "description": "Local Data for Better Health, County Data",
83
85
  "access": [
84
- {
85
- "role": "OWNER",
86
- "groupByEmail": "cloud-datasets-eng@google.com"
87
- },
88
- {
89
- "role": "READER",
90
- "iamMember": "allUsers"
91
- },
92
- {
93
- "role": "READER",
94
- "groupByEmail": "bqml-eng@google.com"
95
- }
86
+ {
87
+ "role": "WRITER",
88
+ "specialGroup": "projectWriters"
89
+ },
90
+ {
91
+ "role": "OWNER",
92
+ "specialGroup": "projectOwners"
93
+ },
94
+ {
95
+ "role": "OWNER",
96
+ "userByEmail": "some-redacted-email@bigquery-public-data.iam.gserviceaccount.com"
97
+ },
98
+ {
99
+ "role": "READER",
100
+ "specialGroup": "projectReaders"
101
+ }
96
102
  ],
97
- "creationTime": "1553208775542",
98
- "lastModifiedTime": "1686338918114",
103
+ "creationTime": "1640891845643",
104
+ "lastModifiedTime": "1640891845643",
99
105
  "location": "US",
100
106
  "type": "DEFAULT",
101
107
  "maxTimeTravelHours": "168"
102
108
  }
103
109
  """
104
110
  try:
105
- bq_client = client.get_bigquery_client(credentials=credentials)
111
+ bq_client = client.get_bigquery_client(
112
+ project=project_id, credentials=credentials
113
+ )
106
114
  dataset = bq_client.get_dataset(
107
115
  bigquery.DatasetReference(project_id, dataset_id)
108
116
  )
@@ -128,16 +136,14 @@ def list_table_ids(
128
136
  list[str]: List of the tables ids present in the dataset.
129
137
 
130
138
  Examples:
131
- >>> list_table_ids("bigquery-public-data", "ml_datasets")
132
- ['census_adult_income',
133
- 'credit_card_default',
134
- 'holidays_and_events_for_forecasting',
135
- 'iris',
136
- 'penguins',
137
- 'ulb_fraud_detection']
139
+ >>> list_table_ids("bigquery-public-data", "cdc_places")
140
+ ['chronic_disease_indicators',
141
+ 'local_data_for_better_health_county_data']
138
142
  """
139
143
  try:
140
- bq_client = client.get_bigquery_client(credentials=credentials)
144
+ bq_client = client.get_bigquery_client(
145
+ project=project_id, credentials=credentials
146
+ )
141
147
 
142
148
  tables = []
143
149
  for table in bq_client.list_tables(
@@ -167,76 +173,93 @@ def get_table_info(
167
173
  dict: Dictionary representing the properties of the table.
168
174
 
169
175
  Examples:
170
- >>> get_table_info("bigquery-public-data", "ml_datasets", "penguins")
176
+ >>> get_table_info("bigquery-public-data", "cdc_places", "local_data_for_better_health_county_data")
171
177
  {
172
178
  "kind": "bigquery#table",
173
- "etag": "X0ZkRohSGoYvWemRYEgOHA==",
174
- "id": "bigquery-public-data:ml_datasets.penguins",
175
- "selfLink":
176
- "https://bigquery.googleapis.com/bigquery/v2/projects/bigquery-public-data/datasets/ml_datasets/tables/penguins",
179
+ "etag": "wx23aDqmgc39oUSiNuYTAA==",
180
+ "id": "bigquery-public-data:cdc_places.local_data_for_better_health_county_data",
181
+ "selfLink": "https://content-bigquery.googleapis.com/bigquery/v2/projects/bigquery-public-data/datasets/cdc_places/tables/local_data_for_better_health_county_data",
177
182
  "tableReference": {
178
- "projectId": "bigquery-public-data",
179
- "datasetId": "ml_datasets",
180
- "tableId": "penguins"
183
+ "projectId": "bigquery-public-data",
184
+ "datasetId": "cdc_places",
185
+ "tableId": "local_data_for_better_health_county_data"
181
186
  },
187
+ "description": "Local Data for Better Health, County Data",
182
188
  "schema": {
183
- "fields": [
184
- {
185
- "name": "species",
186
- "type": "STRING",
187
- "mode": "REQUIRED"
188
- },
189
- {
190
- "name": "island",
191
- "type": "STRING",
192
- "mode": "NULLABLE"
193
- },
194
- {
195
- "name": "culmen_length_mm",
196
- "type": "FLOAT",
197
- "mode": "NULLABLE"
198
- },
199
- {
200
- "name": "culmen_depth_mm",
201
- "type": "FLOAT",
202
- "mode": "NULLABLE"
203
- },
204
- {
205
- "name": "flipper_length_mm",
206
- "type": "FLOAT",
207
- "mode": "NULLABLE"
208
- },
209
- {
210
- "name": "body_mass_g",
211
- "type": "FLOAT",
212
- "mode": "NULLABLE"
213
- },
214
- {
215
- "name": "sex",
216
- "type": "STRING",
217
- "mode": "NULLABLE"
218
- }
219
- ]
189
+ "fields": [
190
+ {
191
+ "name": "year",
192
+ "type": "INTEGER",
193
+ "mode": "NULLABLE"
194
+ },
195
+ {
196
+ "name": "stateabbr",
197
+ "type": "STRING",
198
+ "mode": "NULLABLE"
199
+ },
200
+ {
201
+ "name": "statedesc",
202
+ "type": "STRING",
203
+ "mode": "NULLABLE"
204
+ },
205
+ {
206
+ "name": "locationname",
207
+ "type": "STRING",
208
+ "mode": "NULLABLE"
209
+ },
210
+ {
211
+ "name": "datasource",
212
+ "type": "STRING",
213
+ "mode": "NULLABLE"
214
+ },
215
+ {
216
+ "name": "category",
217
+ "type": "STRING",
218
+ "mode": "NULLABLE"
219
+ },
220
+ {
221
+ "name": "measure",
222
+ "type": "STRING",
223
+ "mode": "NULLABLE"
224
+ },
225
+ {
226
+ "name": "data_value_unit",
227
+ "type": "STRING",
228
+ "mode": "NULLABLE"
229
+ },
230
+ {
231
+ "name": "data_value_type",
232
+ "type": "STRING",
233
+ "mode": "NULLABLE"
234
+ },
235
+ {
236
+ "name": "data_value",
237
+ "type": "FLOAT",
238
+ "mode": "NULLABLE"
239
+ }
240
+ ]
220
241
  },
221
- "numBytes": "28947",
222
- "numLongTermBytes": "28947",
223
- "numRows": "344",
224
- "creationTime": "1619804743188",
225
- "lastModifiedTime": "1634584675234",
242
+ "numBytes": "234849",
243
+ "numLongTermBytes": "0",
244
+ "numRows": "1000",
245
+ "creationTime": "1640891846119",
246
+ "lastModifiedTime": "1749427268137",
226
247
  "type": "TABLE",
227
248
  "location": "US",
228
- "numTimeTravelPhysicalBytes": "0",
229
- "numTotalLogicalBytes": "28947",
230
- "numActiveLogicalBytes": "0",
231
- "numLongTermLogicalBytes": "28947",
232
- "numTotalPhysicalBytes": "5350",
233
- "numActivePhysicalBytes": "0",
234
- "numLongTermPhysicalBytes": "5350",
235
- "numCurrentPhysicalBytes": "5350"
249
+ "numTimeTravelPhysicalBytes": "285737",
250
+ "numTotalLogicalBytes": "234849",
251
+ "numActiveLogicalBytes": "234849",
252
+ "numLongTermLogicalBytes": "0",
253
+ "numTotalPhysicalBytes": "326557",
254
+ "numActivePhysicalBytes": "326557",
255
+ "numLongTermPhysicalBytes": "0",
256
+ "numCurrentPhysicalBytes": "40820"
236
257
  }
237
258
  """
238
259
  try:
239
- bq_client = client.get_bigquery_client(credentials=credentials)
260
+ bq_client = client.get_bigquery_client(
261
+ project=project_id, credentials=credentials
262
+ )
240
263
  return bq_client.get_table(
241
264
  bigquery.TableReference(
242
265
  bigquery.DatasetReference(project_id, dataset_id), table_id