Skip to main content

Wrapper around azure-kusto client to facilitate bringing BIG query results while avoiding hitting the limits

Project description

big-query-kusto-client

Package to facilitate the gathering of big datasets from Azure Data Explorer by paginating

Usage

from bigquerykustoclient import BigQueryKustoClient

# Resolve the KQL client how ever you see fit
kusto = build_kusto_client()

# pass it on the constructor
# and much better using with:

with BigQueryKustoClient(kusto) as client:
    df: pandas.DataFrame = client.execute_query(
        db='ContosoSales',
        query= 'SaltesTable | order by DateKey, ProductKey, CustomerKey',
        optimal_page=True
    )

len(df)  # Will give you the amount of rows it broght for you

Important Note

For this to work it is required that the query imposes an order on the results, no matter what column you use but an | order by operator must be in the query.

Other considerations

The package uses this other values from the system for its configuration. It tries to keep sensible defaults:

ADX_RECORDS_LIMIT=500000  # Limit of amount of rows in ADX
ADX_SIZE_IN_BYTES_LIMIT=67108864  # 64MB limit of size of result
BQKC_PAGE_SIZE=100000  # Default pagesize that we'll use to paginate the results
BQKC_SQ_PREFIX=BigQueryKustoClient  # A prefix that will be used as namespace for the queries

BQKC_PAGE_SIZE will get overridden if the parameter optimal_page=True is used. When done so, the pacakge will try to determine the biggest possible size of page to use.

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

big_query_kusto_client-0.3.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

big_query_kusto_client-0.3.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file big_query_kusto_client-0.3.0.tar.gz.

File metadata

  • Download URL: big_query_kusto_client-0.3.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.9.13 Windows/10

File hashes

Hashes for big_query_kusto_client-0.3.0.tar.gz
Algorithm Hash digest
SHA256 5ac3f4cf2037eac9ba38b15edffe1e1c254729bbc53c93b679922f661565a673
MD5 a90f007a124e2d966e76e402b50b95aa
BLAKE2b-256 4a209a9cb9df4c8f5d0d8af525797466fdb63c075fd19eac7bfe8359a565db51

See more details on using hashes here.

File details

Details for the file big_query_kusto_client-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for big_query_kusto_client-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 823eb3d877f66ab37bdfbd440c69ada0fa2e2a7c7880fd29d9e5b07d7356c160
MD5 e1a950887a1376ffd5a89a84178d0f65
BLAKE2b-256 8639d4f03f421d5a15263aae0393dd7c5adb23493148894782816c57c061ce28

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