BigtableDataClientAsync(
*,
project: str | None = None,
credentials: google.auth.credentials.Credentials | None = None,
client_options: (
dict[str, Any] | "google.api_core.client_options.ClientOptions" | None
) = None,
**kwargs
)
Create a client instance for the Bigtable Data API
Client should be created within an async context (running event loop)
Methods
close
close(timeout: float | None = 2.0)
Cancel all background tasks
execute_query
execute_query(query: str, instance_id: str, *, parameters: dict[str, ExecuteQueryValueType] | None = None, parameter_types: dict[str, SqlType.Type] | None = None, app_profile_id: str | None = None, operation_timeout: float = 600, attempt_timeout: float | None = 20, retryable_errors: Sequence[type[Exception]] = (<class 'google.api_core.exceptions.DeadlineExceeded'>, <class 'google.api_core.exceptions.ServiceUnavailable'>, <class 'google.api_core.exceptions.Aborted'>), prepare_operation_timeout: float = 60, prepare_attempt_timeout: float | None = 20, prepare_retryable_errors: Sequence[type[Exception]] = (<class 'google.api_core.exceptions.DeadlineExceeded'>, <class 'google.api_core.exceptions.ServiceUnavailable'>)) -> ExecuteQueryIteratorAsync
Executes an SQL query on an instance. Returns an iterator to asynchronously stream back columns from selected rows.
Failed requests within operation_timeout will be retried based on the retryable_errors list until operation_timeout is reached.
Note that this makes two requests, one to PrepareQuery
and one to ExecuteQuery
.
These have separate retry configurations. ExecuteQuery
is where the bulk of the
work happens.
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.DeadlineExceeded |
raised after operation timeout will be chained with a RetryExceptionGroup containing GoogleAPIError exceptions from any retries that failed |
google.api_core.exceptions.GoogleAPIError |
raised if the request encounters an unrecoverable error |
google.cloud.bigtable.data.exceptions.ParameterTypeInferenceFailed |
Raised if a parameter is passed without an explicit type, and the type cannot be infered |
Returns | |
---|---|
Type | Description |
ExecuteQueryIteratorAsync |
an asynchronous iterator that yields rows returned by the query |
get_authorized_view
get_authorized_view(
instance_id: str, table_id: str, authorized_view_id: str, *args, **kwargs
) -> google.cloud.bigtable.data._async.client.AuthorizedViewAsync
Returns an authorized view instance for making data API requests. All arguments are passed directly to the AuthorizedViewAsync constructor.
Must be created within an async context (running event loop)
Exceptions | |
---|---|
Type | Description |
RuntimeError |
if called outside of an async context (no running event loop) |
Returns | |
---|---|
Type | Description |
AuthorizedViewAsync |
a table instance for making data API requests |
get_table
get_table(
instance_id: str, table_id: str, *args, **kwargs
) -> google.cloud.bigtable.data._async.client.TableAsync
Returns a table instance for making data API requests. All arguments are passed directly to the TableAsync constructor.
Must be created within an async context (running event loop)
Exceptions | |
---|---|
Type | Description |
RuntimeError |
if called outside of an async context (no running event loop) |
Returns | |
---|---|
Type | Description |
TableAsync |
a table instance for making data API requests |