ploosh.
Documentation
BigQuery
This connector is used to query Google BigQuery using SQL.
Connection configuration
| Name | Mandatory | Default | Description |
|---|---|---|---|
| credentialstype | no | serviceaccount | Authentication type: serviceaccount or currentuser |
| credentials | no | Google keyfile encoded in base64 (for serviceaccount mode) | |
| projectid | no | Google Cloud project ID (for current_user mode) |
credentialstype is serviceaccount, the credentials parameter must contain a base64-encoded Google service account keyfile.When credentialstype is currentuser, the connector uses pandasgbq with the default credentials from the environment (e.g. gcloud CLI or the GOOGLEAPPLICATION_CREDENTIALS environment variable).
⚠️ It is highly recommended to use a custom parameter to pass the credentials value.
Example
connections:
bigquery_example:
type: bigquery
credentialstype: serviceaccount
credentials: $var.gbq_credentials
Test case configuration
| Name | Mandatory | Default | Description |
|---|---|---|---|
| query | yes | SQL query to execute |
Example
Example BigQuery:
source:
type: bigquery
connection: bigquery_example
query: |
SELECT *
FROM rh.employees
WHERE hire_date < "2000-01-01"
expected:
type: csv
path: data/employeesbefore2000.csv
Requirements
pip install pandas-gbq(included inplooshfull installation)- For
service_accountmode: a valid Google Cloud service account keyfile