BigQuery¶
Installation¶
Connection URL¶
Connect to BigQuery by passing a connection URL to the Database
constructor:
Connection Parameters¶
Alternatively, connect using the Database.from_bigquery()
method with parameters:
PARAMETER | DESCRIPTION |
---|---|
project_id
|
A BigQuery project id.
TYPE:
|
dataset_id
|
A dataset id that lives inside of the project indicated by project_id. Default is ''.
TYPE:
|
credentials
|
Optional credentials.
TYPE:
|
application_name
|
A string identifying your application to Google API endpoints.
TYPE:
|
auth_local_webserver
|
Use a local webserver for the user authentication. Binds a webserver to an open port on localhost between 8080 and 8089, inclusive, to receive authentication token. If not set, defaults to False, which requests a token via the console. Default is True.
TYPE:
|
auth_external_data
|
Authenticate using additional scopes required to query external data sources, such as Google Sheets, files in Google Cloud Storage, or files in Google Drive. If not set, defaults to False, which requests the default BigQuery scopes. Default is False.
TYPE:
|
auth_cache
|
Selects the behavior of the credentials cache. 'default' - Reads credentials from disk if available, otherwise authenticates and caches credentials to disk. 'reauth' - Authenticates and caches credentials to disk. 'none' - Authenticates and does not cache credentials. Default is 'default'.
TYPE:
|
partition_column
|
Identifier to use instead of default _PARTITIONTIME partition column. Default is 'PARTITIONTIME'.
TYPE:
|
client
|
A Client from the google.cloud.bigquery package. If not set, one is created using the project_id and credentials.
TYPE:
|
storage_client
|
A BigQueryReadClient from the google.cloud.bigquery_storage_v1 package. If not set, one is created using the project_id and credentials.
TYPE:
|
location
|
Default location for BigQuery objects.
TYPE:
|
generate_job_id_prefix
|
Optional callable that generates a bigquery job ID prefix. If specified, for any query job, jobs will always be created rather than optionally created by BigQuery's Client.query_and_wait.
TYPE:
|
match_schema
|
Regex pattern to filter schemas. Mutually exclusive with match_tables.
TYPE:
|
match_tables
|
Regex pattern to filter tables. Mutually exclusive with match_schema.
TYPE:
|
**kwargs
|
Additional arguments passed to the DBAPI connection call.
TYPE:
|