Skip to content

Commit

Permalink
chore: use default for unset app_profile_id
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-sanche committed Nov 22, 2024
1 parent 7ea3c23 commit 48b7a5e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion google/cloud/bigtable/data/_async/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ def get_table(self, instance_id: str, table_id: str, *args, **kwargs) -> TableAs
table_id: The ID of the table. table_id is combined with the
instance_id and the client's project to fully specify the table
app_profile_id: The app profile to associate with requests.
If not set, will use "default".
https://cloud.google.com/bigtable/docs/app-profiles
default_read_rows_operation_timeout: The default timeout for read rows
operations, in seconds. If not set, defaults to 600 seconds (10 minutes)
Expand Down Expand Up @@ -542,6 +543,7 @@ async def execute_query(
detected automatically (i.e. the value can be None, an empty list or
an empty dict).
app_profile_id: The app profile to associate with requests.
If not set, will use "default".
https://cloud.google.com/bigtable/docs/app-profiles
operation_timeout: the time budget for the entire operation, in seconds.
Failed requests will be retried within the budget.
Expand Down Expand Up @@ -571,6 +573,8 @@ async def execute_query(
pb_params = _format_execute_query_params(parameters, parameter_types)

instance_name = self._gapic_client.instance_path(self.project, instance_id)
if app_profile_id is None:
app_profile_id = "default"

request_body = {
"instance_name": instance_name,
Expand Down Expand Up @@ -662,6 +666,7 @@ def __init__(
table_id: The ID of the table. table_id is combined with the
instance_id and the client's project to fully specify the table
app_profile_id: The app profile to associate with requests.
If not set, will use "default".
https://cloud.google.com/bigtable/docs/app-profiles
default_read_rows_operation_timeout: The default timeout for read rows
operations, in seconds. If not set, defaults to 600 seconds (10 minutes)
Expand Down Expand Up @@ -713,7 +718,9 @@ def __init__(
self.table_name = self.client._gapic_client.table_path(
self.client.project, instance_id, table_id
)
self.app_profile_id = app_profile_id
self.app_profile_id = (
app_profile_id if app_profile_id is not None else "default"
)

self.default_operation_timeout = default_operation_timeout
self.default_attempt_timeout = default_attempt_timeout
Expand Down

0 comments on commit 48b7a5e

Please sign in to comment.