What's new:
- using black in __init__.py
- Adding message for bigquery when pandas is not installed
- fixing code smells __init__.py
- removing code smells __init__.py
- fixing import order and formatting logger
- adding bqstorage to readme
- adding bq to index
- adding test instructions to DEV.md
- Adding BQ Storage API. Refactoring.
- Adding unit tests for BQ and BQ Storage.
In case one needs a service account with access to BigQuery, the following code can be
used:
python
from pycarol import Carol
from pycarol.bigquery import TokenManager
tm = TokenManager(Carol())
service_account = tm.get_token().service_account
PyCarol provides access to BigQuery Storage API also. It allows for much faster reading
times, but with limited querying capabilities. For instance, only tables are readable,
so 'ingestion_stg_model_deep_audit' is ok, but 'stg_model_deep_audit' is not (it is a
view).
python
from pycarol import BQStorage, Carol
bq = BQStorage(Carol())
table_name = "ingestion_stg_model_deep_audit"
col_names = ["request_id", "version"]
df = bq.query(table_name, col_names, return_dataframe=True)ken().service_account