Skip to content
This repository was archived by the owner on May 16, 2026. It is now read-only.
This repository was archived by the owner on May 16, 2026. It is now read-only.

Default dataset feature does not work with google-cloud-bigquery 1.22.0 #43

Closed

Description

@alonme

Hi,

It seems that creating an engine with a default dataset like in the readme example
engine = create_engine('bigquery://project/dataset')

Does not work with the newest version of the bigquery library - 1.22.0.

When trying to perform a query:
sqlalchemy.exc.DatabaseError: (google.cloud.bigquery.dbapi.exceptions.DatabaseError) 400 Table name "my_table_name" missing dataset while no default dataset is set in the request.

Works fine with:

  • Version 1.21.0
  • Using the dataset as a prefix to the table name

Thanks!

Activity

  1. added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Nov 26, 2019
  2. tswast commented on Nov 26, 2019

    @tswast
    Contributor

    I thought this might be a regression in google-cloud-bigquery, but I'm unable to reproduce with either the query() method or the DB-API.

    from google.cloud import bigquery
    
    
    print(bigquery.__version__)
    
    default_config = bigquery.QueryJobConfig(
        default_dataset="bigquery-public-data.usa_names"
    )
    
    client = bigquery.Client(default_query_job_config=default_config)
    
    
    sql = """
    SELECT name, SUM(number) as total_people
    FROM usa_1910_2013
    WHERE state = 'TX'
    GROUP BY name, state
    ORDER BY total_people DESC
    LIMIT 5
    """
    
    rows = client.query(sql, job_config=bigquery.QueryJobConfig(use_legacy_sql=False))
    
    print("with query():")
    for row in rows:
        print(row["name"])
    
    
    from google.cloud.bigquery import dbapi
    
    connection = dbapi.connect(client=client)
    cursor = connection.cursor()
    
    print("with dbapi:")
    cursor.execute(sql)
    rows = cursor.fetchall()
    
    for row in rows:
        print(row[0])

    Output:

    1.22.0
    with query():
    James
    John
    Michael
    Robert
    David
    with dbapi:
    James
    John
    Michael
    Robert
    David
    
  3. alonme commented on Nov 26, 2019

    @alonme
    ContributorAuthor

    Please assign to me, started working on resolving the issue.

  4. winstonll commented on Nov 30, 2019

    @winstonll

    Please assign to me, started working on resolving the issue.

    Thanks, I am having similar issues too. Look forward to your solution.

  5. alonme commented on Dec 3, 2019

    @alonme
    ContributorAuthor

    Opened a PR
    #44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions