Skip to content

Dry run queries fail with 404:Not found job #56

@diego-serrano-glean

Description

@diego-serrano-glean

While using the library to execute a query in dry run mode, I got an error like the following: 404 GET https://bigquery.googleapis.com/bigquery/v2/projects/MYDATASET/queries/None?maxResults=0&location=US: Not found: Job MYDATASET:US.None

The code I used to execute the query is:

from pybigquery.api import ApiClient

credentials_info = {
  "type": "...",
  "project_id": "...",
  "private_key_id": "...",
  "private_key": "...",
  "client_email": "...",
  "client_id": "...",
  "auth_uri": "...",
  "token_uri": "...",
  "auth_provider_x509_cert_url": "...",
  "client_x509_cert_url": "..."
}

engine = create_engine('bigquery:///MYDATASET?dry_run=true', credentials_info=credentials_info)
query = 'SELECT column1 FROM `myschema`.`mytable` LIMIT 1'

try:
    with engine.connect() as conn:
      results = conn.execute(query)

When I execute the query with an engine that does not specify the dry run (e.g. engine = create_engine('bigquery:///MYDATASET', credentials_info=credentials_info)), the results are returned correctly.

Am I missing some parameters or special configuration for dry run queries?

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: bigqueryIssues related to the googleapis/python-bigquery-sqlalchemy API.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