SQL testing tool for Google BigQuery
Project description
SQL testing tool for Google BigQuery.
this library is pre-alpha. not recommended to production use.
Getting Started
pip install bqspec
gcloud auth application-default login
How to Use
spec.yaml
# test target SQL filepath
query_path: ./sample.sql
# any BigQuery query parameters (optional). more details: https://cloud.google.com/bigquery/docs/parameterized-queries
params:
- type: DATE
name: date
value: 2017-11-30
# known columns (optional).
columns:
- id
- a
- b
- c
- total
# conditions which all rows must met (optional).
invariants:
- total >= 0 # write python expression
- a + b == c
# any test cases
cases:
- where:
- id == 1
expected:
- total == 15
- a == 2
- b == 3
- c == 5
bqspec -f spec.yaml
or
bqspec -d .
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bqspec-0.3.2.tar.gz
(8.5 kB
view hashes)
Built Distribution
bqspec-0.3.2-py2.py3-none-any.whl
(10.6 kB
view hashes)
Close
Hashes for bqspec-0.3.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3b866ee2fb90a1e591c829535858e17ff8a8141655d7070b4583c16c92323d8 |
|
MD5 | e488a867848da288d8986b2cf217b4df |
|
BLAKE2b-256 | 5a6fbd68f7abdcad933b1f0b659253e527249f3ea7f4632342365b5ea89761b2 |