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

PyPI Downloads

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.

Contributing

Please see CONTRIBUTING.md for guidelines on how to contribute to this project, including the release process.

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.4.1.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

big_query_kusto_client-0.4.1-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: big_query_kusto_client-0.4.1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.10.20 Linux/6.17.0-1018-azure

File hashes

Hashes for big_query_kusto_client-0.4.1.tar.gz
Algorithm Hash digest
SHA256 b6fa07005aad81e367d3cb0a65a96c8972d7a970697d21f3b96dbc95bce895a9
MD5 44863470285f814a8cd4a8d4058a2c45
BLAKE2b-256 e94fcacfc78e9e21e95319d4b0aa2f01698df12394577c1e4fd68db1322db0d8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for big_query_kusto_client-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e25e3c271499bc21f1ce2350011561b495c09cd377988dee1c36979e693e27a8
MD5 6d3b4e875cf3095faf1063a000b546e3
BLAKE2b-256 305f20e86b1a60c19733bc98380f7157adcf283eee89254bbb4cac258f6f9e02

See more details on using hashes here.

Supported by

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