LeveredDocs

BigQuery

Connect a Google Cloud BigQuery dataset to Levered.

What you need

ItemDescription
Service account keyThe JSON key of a service account with BigQuery Data Viewer and BigQuery Job User roles. Levered reads the project ID from it.
DatasetThe BigQuery dataset that contains the exposures and rewards tables. Enter it in the Dataset field when connecting. The default is levered. The dataset can be changed on the connection card after saving.

Create the service account

If no service account with these roles exists, create one:

  1. Go to the Google Cloud Console IAM page.
  2. Create a service account, for example levered-reader.
  3. Grant it the BigQuery Data Viewer and BigQuery Job User roles on the project.
  4. Create a JSON key and download it.

Connect via the dashboard

The dashboard requires an existing exposures table and rewards table before it saves the connection. Create the tables first (Create the table).

  1. Click Warehouse in the Levered dashboard sidebar.
  2. Click BigQuery.
  3. Paste the contents of the key file into Service Account Key (JSON).
  4. Enter the dataset that contains the tables in Dataset and click Next. The default is levered. The name can contain only letters, numbers and underscores.
  5. Select the Exposures table and the Rewards table from that dataset.
  6. Click Save Connection.
  7. Click Test connection on the connection card to verify that Levered can reach the warehouse.

Troubleshooting

Connection test fails

Confirm that the service account has the BigQuery Data Viewer and BigQuery Job User roles. Check that the project ID and the dataset ID are correct and that the dataset exists.

Permission errors at training time

Levered runs SQL queries during model training. If training fails with a permission error, check that the service account has SELECT access to the tables that the metric queries reference.

Next step

Set up the data pipeline to log exposures and rewards into the tables that Levered reads during training.