yu-iskw / bq-validator

Yet another BigQuery query validator

Home Page:https://pypi.org/project/bq-validator/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Test python Package version Supported Python versions

bq-validator

This is a yet another python-based BigQuery query validator.

The bq query --dry_run command enables us to validate queries. However, the bq command doesn't support service account impersonation, even though it supports workload identity federation credentials at Google Cloud SDK 390.0.0. The bq-validator command would be useful, when we take advantage of service account impersonation to validate BigQuery queries.

Install

The package is available on pypi

pip install -U bq-validator

How to use

$ bq-validator --help
Usage: bq-validator [OPTIONS] PATH

  Validate BigQuery queries

  PATH is either of a SQL file path or a directory. When it is a directory,
  the command recursively validates all SQL files in the directory.

Options:
  --quota_project TEXT            BigQuery client project ID
  --client_project TEXT           BigQuery client project ID
  --client_location TEXT          BigQuery client location
  --impersonate_service_account TEXT
                                  Impersonate service account email
  --num_parallels INTEGER         Number of parallel query validations
  --verbose                       Enable verbose output
  --version                       Show the version and exit.
  --help                          Show this message and exit.

About

Yet another BigQuery query validator

https://pypi.org/project/bq-validator/

License:Apache License 2.0


Languages

Language:Python 61.7%Language:Shell 33.6%Language:Makefile 4.7%