Skip to main content

bqemulatormanager is a wrapper of bigquery-emulator which provides us BigQuery mock working in local machine.

Project description

BiqQueryEmulator Manager

this package is wrapper of bigquery-emulator which provides us BigQuery mock working in local machine.

using this package, you can

  • do unit test of your sql
  • download the schema of big query, and use it to make test data

usage

  1. following instruction, download bigquery-emulator command.

  2. install this package.

pip install bqemulatormanager
  1. test your sql.
import bqemulatormanager as bqem
import pandas as pd

manager = bqem.Manager(project='test', schema_path='resources/schema_example.yaml')

with manager:
    data = pd.DataFrame([
        {'id': 1, 'name': 'sato'},
        {'id': 2, 'name': 'yamada'}
    ])

    manager.load(data, 'dataset1.table_a')

    sql = 'SELECT id, name FROM `dataset1.table_a`'

    df = manager.query(sql)
print(df)

unit test example is here.

automatically detect schema

When called Manager.load, SchemaManager search correspond table schema from schema_path (default is bqem_master_schema.yaml).

If schema definition cannot be found, SchemaManager request it from BigQuery in production environment and update master schema file.

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

bqemulatormanager-0.2.3.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

bqemulatormanager-0.2.3-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file bqemulatormanager-0.2.3.tar.gz.

File metadata

  • Download URL: bqemulatormanager-0.2.3.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for bqemulatormanager-0.2.3.tar.gz
Algorithm Hash digest
SHA256 5c0702c2d923c79ffb4d90b30417226f4f766cd05e4abbefd4182043519f448f
MD5 32b6e32c28b08203c8cefc174e66be63
BLAKE2b-256 7320cbdfd55dc24f61760509cca92b47b231d9cb51b90984da52af904b1b5b26

See more details on using hashes here.

Provenance

The following attestation bundles were made for bqemulatormanager-0.2.3.tar.gz:

Publisher: publish.yml on m3dev/bqemulatormanager

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bqemulatormanager-0.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for bqemulatormanager-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 07f031a6f3e52c1d4a24eff9f55e66817ecddb4d5a336fddeed7f4c3000254c7
MD5 cf0f9506ef59b59e253860f31e1b36f2
BLAKE2b-256 e39faab7e50afcbdcee2ed9529db09ce62181c0ba0a4cce8dd982d2f9ad07514

See more details on using hashes here.

Provenance

The following attestation bundles were made for bqemulatormanager-0.2.3-py3-none-any.whl:

Publisher: publish.yml on m3dev/bqemulatormanager

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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