Skip to main content

Test BigQuery query using BigQuery

Project description

WIP: BigQueryのクエリをテストするためのツール

Run pytest

BigQueryへのクエリロジックのテストができます

Usage

from bqqtest import QueryTest
from google.cloud import bigquery

expected = {'schema': [('name', 'STRING'), ('value', 'INT64')], 'datum': [['abc', 100]]}
tables = [{'schema': [('name', 'STRING'), ('value', 'INT64')], 'datum': [['abc', 100]], 'name': 'INPUT_DATA'}]
query = {'query': 'SELECT * FROM hogehoge', 'map': {'hogehoge': 'INPUT_DATA'}, 'params': []}
qt = QueryTest(bigquery.Client(), expected, tables, query)
success, diff = qt.run()
success # True

特徴

  • WITHを利用してテストデータを一時的に生成します。このデータはBigQueryに保存されません。BigQueryは保存されているデータ走査した量とAPIリクエスト数で課金されるため、課金額を抑えた状態でテストできます

注意

BigQueryへ直接クエリを発行します。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bqqtest-0.2.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

bqqtest-0.2.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file bqqtest-0.2.0.tar.gz.

File metadata

  • Download URL: bqqtest-0.2.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.3 CPython/3.7.6 Darwin/18.7.0

File hashes

Hashes for bqqtest-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8d5a6996ee863484ea98de03230a0ea5a64f5df85e4dc50578fc0ee61d5452a3
MD5 c182aaa3862d070a1ce2267095f4dd92
BLAKE2b-256 3c4e97c951f59dacbeb08b3b6b7c681be9997353b2887a19ace0e0a13f0df430

See more details on using hashes here.

File details

Details for the file bqqtest-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: bqqtest-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.3 CPython/3.7.6 Darwin/18.7.0

File hashes

Hashes for bqqtest-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3eb6831f77e9c5cd4cc6dfb2e9a1ec3b291dc5a2d6efe4aee20d3b0257fbd7c2
MD5 5c7dd8b1a70ecb095b94378ba314dd4a
BLAKE2b-256 8ffe9abcecb1e0306894ec3e5633edaa6bf9d4a38ae357344a5bd16590f4c10f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page