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.3.tar.gz
(8.5 kB
view details)
Built Distribution
File details
Details for the file bqspec-0.3.3.tar.gz
.
File metadata
- Download URL: bqspec-0.3.3.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.36.1 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b238e1f43f98371d805405534ae46f844e4e2d6a7305ade7b6f636e5a46eca7d |
|
MD5 | 746e90a7d44c8611a3f8cc76d402e307 |
|
BLAKE2b-256 | 586529f1b75fd09821d68ea000fde17db215a0a639cbef6feb5075841fb1d502 |
File details
Details for the file bqspec-0.3.3-py2.py3-none-any.whl
.
File metadata
- Download URL: bqspec-0.3.3-py2.py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.36.1 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ecf65ae4742aaaa097075af0cf2d5a50a4de206853004ab7429d1305cc886311 |
|
MD5 | 3d28fab848f029e28d8440e60a2c3ef5 |
|
BLAKE2b-256 | 4d627acbb0e017da3eb37b8b74a774119d22c9532ae613d5fb94f66c0a4ecbc7 |