Skip to content

Python BigQuery Documentation is Broken #2893

Open
@WillAyd

Description

@WillAyd

What happened?

The Python README for bigquery has a few issues with it that prevent it from being usable.

https://pypi.org/project/adbc-driver-bigquery/

import adbc_driver_bigquery.dbapi
from adbc_driver_bigquery import DatabaseOptions

db_kwargs = {
    DatabaseOptions.AUTH_TYPE.value: DatabaseOptions.AUTH_VALUE_CREDENTIALS_FILE,
    DatabaseOptions.CREDENTIALS.value: "credentials.json",
    DatabaseOptions.PROJECT_ID.value: "bigquery-poc-418913",
    DatabaseOptions.DATASET_ID.value: "google_trends",
    DatabaseOptions.TABLE_ID.value: "small_top_terms",
}
with adbc_driver_bigquery.dbapi.connect(db_kwargs) as conn:
    with conn.cursor() as cur:
        cur.execute("SELECT 1")
        print(cur.fetch_arrow_table())

I am at least under the impression that the DatabaseOptions.AUTH_VALUE_CREDENTIALS_FILE should read DatabaseOptions.AUTH_VALUE_JSON_CREDENTIALS_FILE, but simply changing that leads to a slew of other errors about how the values are being interpreted and passed to the driver manager

Stack Trace

AttributeError: type object 'DatabaseOptions' has no attribute 'AUTH_VALUE_CREDENTIALS_FILE'

How can we reproduce the bug?

No response

Environment/Setup

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions