Skip to main content

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 .

Author

@orisano (Nao YONASHIRO)

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)

Source distribution for bqspec 0.3.3
File Size Uploaded
bqspec-0.3.3.tar.gz 8.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bqspec 0.3.3
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.3.3 This release

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page