bigquery.job

Classes

Job

Module Contents

class bigquery.job.Job(job_id=None, project=None, service_file=None, session=None, token=None, api_root=None, location=None)

Bases: bigquery.bigquery.BigqueryBase

Parameters:
  • job_id (Optional[str])

  • project (Optional[str])

  • service_file (Optional[Union[str, IO[AnyStr]]])

  • session (Optional[requests.Session])

  • token (Optional[gcloud.aio.auth.Token])

  • api_root (Optional[str])

  • location (Optional[str])

job_id = None
location = None
static _make_query_body(query, write_disposition, use_query_cache, dry_run, use_legacy_sql, destination_table)
Parameters:
  • query (str)

  • write_disposition (bigquery.bigquery.Disposition)

  • use_query_cache (bool)

  • dry_run (bool)

  • use_legacy_sql (bool)

  • destination_table (Optional[Any])

Return type:

Dict[str, Any]

_config_params(params=None)
Parameters:

params (Optional[Dict[str, Any]])

Return type:

Dict[str, Any]

async get_job(session=None, timeout=60)

Get the specified job resource by job ID.

Parameters:
  • session (Optional[requests.Session])

  • timeout (int)

Return type:

Dict[str, Any]

async get_query_results(session=None, timeout=60, params=None)

Get the specified jobQueryResults by job ID.

Parameters:
  • session (Optional[requests.Session])

  • timeout (int)

  • params (Optional[Dict[str, Any]])

Return type:

Dict[str, Any]

async cancel(session=None, timeout=60)

Cancel the specified job by job ID.

Parameters:
  • session (Optional[requests.Session])

  • timeout (int)

Return type:

Dict[str, Any]

async query(query_request, session=None, timeout=60)

Runs a query synchronously and returns query results if completes within a specified timeout.

Parameters:
  • query_request (Dict[str, Any])

  • session (Optional[requests.Session])

  • timeout (int)

Return type:

Dict[str, Any]

async insert(job, session=None, timeout=60)

Insert a new asynchronous job.

Parameters:
  • job (Dict[str, Any])

  • session (Optional[requests.Session])

  • timeout (int)

Return type:

Dict[str, Any]

async insert_via_query(query, session=None, write_disposition=Disposition.WRITE_EMPTY, timeout=60, use_query_cache=True, dry_run=False, use_legacy_sql=True, destination_table=None)

Create table as a result of the query

Parameters:
  • query (str)

  • session (Optional[requests.Session])

  • write_disposition (bigquery.bigquery.Disposition)

  • timeout (int)

  • use_query_cache (bool)

  • dry_run (bool)

  • use_legacy_sql (bool)

  • destination_table (Optional[Any])

Return type:

Dict[str, Any]

async result(session=None)
Parameters:

session (Optional[requests.Session])

Return type:

Dict[str, Any]

async delete(session=None, job_id=None, timeout=60)

Delete the specified job by job ID.

Parameters:
  • session (Optional[requests.Session])

  • job_id (Optional[str])

  • timeout (int)

Return type:

Dict[str, Any]