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.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file big_query_kusto_client-0.4.0.tar.gz.
File metadata
- Download URL: big_query_kusto_client-0.4.0.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.10.17 Linux/6.11.0-1015-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96448b806890c89ff1ba9e72deaccd396eba2cda910ddd65bdd63f7cd6e97fcd
|
|
| MD5 |
6c54cbe10261f2b001dd20ee57a88489
|
|
| BLAKE2b-256 |
190e4d6e9052b51b6d66c08ead18a491ce56754286d60c340594c59b21c53433
|
File details
Details for the file big_query_kusto_client-0.4.0-py3-none-any.whl.
File metadata
- Download URL: big_query_kusto_client-0.4.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.10.17 Linux/6.11.0-1015-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9fb244a32c1a16639f9faee5a865af787af44fa90c0cd96b85cd0f2227ebb157
|
|
| MD5 |
b5effcd91e4bf2a02a41b1e25546655d
|
|
| BLAKE2b-256 |
abf8cd244b19b9a9f97c517e3b478dd1eb5bee6d53d98eb05157339cc32c9a7b
|