BQSpec
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
Release files for bqspec 0.3.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bqspec-0.3.3.tar.gz | 8.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bqspec-0.3.3-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size:19.1 kB
Release files / bqspec-0.3.3.tar.gz
| Download URL | bqspec-0.3.3.tar.gz |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b238e1f43f98371d805405534ae46f844e4e2d6a7305ade7b6f636e5a46eca7d
|
|
BLAKE2b-256 checksum How to use checksums |
586529f1b75fd09821d68ea000fde17db215a0a639cbef6feb5075841fb1d502
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / bqspec-0.3.3-py2.py3-none-any.whl
| Download URL | bqspec-0.3.3-py2.py3-none-any.whl |
|---|---|
| Size | 10.6 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
ecf65ae4742aaaa097075af0cf2d5a50a4de206853004ab7429d1305cc886311
|
|
BLAKE2b-256 checksum How to use checksums |
4d627acbb0e017da3eb37b8b74a774119d22c9532ae613d5fb94f66c0a4ecbc7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|