bigquery.bigquery

bigquery.bigquery

bigquery.bigquery

Module Contents

Classes

SourceFormat

Create a collection of name/value pairs.

Disposition

Create a collection of name/value pairs.

SchemaUpdateOption

Create a collection of name/value pairs.

BigqueryBase

Functions

init_api_root(api_root)

Attributes

SCOPES

log

bigquery.bigquery.SCOPES = ['https://www.googleapis.com/auth/bigquery.insertdata', 'https://www.googleapis.com/auth/bigquery']
bigquery.bigquery.log
bigquery.bigquery.init_api_root(api_root)
Parameters:

api_root (Optional[str]) –

Return type:

Tuple[bool, str]

class bigquery.bigquery.SourceFormat(*args, **kwds)

Bases: enum.Enum

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

    >>> Color.RED
    <Color.RED: 1>
    
  • value lookup:

    >>> Color(1)
    <Color.RED: 1>
    
  • name lookup:

    >>> Color['RED']
    <Color.RED: 1>
    

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

AVRO = 'AVRO'
CSV = 'CSV'
DATASTORE_BACKUP = 'DATASTORE_BACKUP'
NEWLINE_DELIMITED_JSON = 'NEWLINE_DELIMITED_JSON'
ORC = 'ORC'
PARQUET = 'PARQUET'
class bigquery.bigquery.Disposition(*args, **kwds)

Bases: enum.Enum

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

    >>> Color.RED
    <Color.RED: 1>
    
  • value lookup:

    >>> Color(1)
    <Color.RED: 1>
    
  • name lookup:

    >>> Color['RED']
    <Color.RED: 1>
    

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

WRITE_APPEND = 'WRITE_APPEND'
WRITE_EMPTY = 'WRITE_EMPTY'
WRITE_TRUNCATE = 'WRITE_TRUNCATE'
class bigquery.bigquery.SchemaUpdateOption(*args, **kwds)

Bases: enum.Enum

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

    >>> Color.RED
    <Color.RED: 1>
    
  • value lookup:

    >>> Color(1)
    <Color.RED: 1>
    
  • name lookup:

    >>> Color['RED']
    <Color.RED: 1>
    

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

ALLOW_FIELD_ADDITION = 'ALLOW_FIELD_ADDITION'
ALLOW_FIELD_RELAXATION = 'ALLOW_FIELD_RELAXATION'
class bigquery.bigquery.BigqueryBase(project=None, service_file=None, session=None, token=None, api_root=None)
Parameters:
  • project (Optional[str]) –

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

  • session (Optional[requests.Session]) –

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

  • api_root (Optional[str]) –

_project: str | None
_api_root: str
_api_is_dev: bool
async project()
Return type:

str

async headers()
Return type:

Dict[str, str]

async _post_json(url, body, session, timeout, params=None)
Parameters:
  • url (str) –

  • body (Dict[str, Any]) –

  • session (Optional[requests.Session]) –

  • timeout (int) –

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

Return type:

Dict[str, Any]

async _get_url(url, session, timeout, params=None)
Parameters:
  • url (str) –

  • session (Optional[requests.Session]) –

  • timeout (int) –

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

Return type:

Dict[str, Any]

async _delete(url, session, timeout, params=None)
Parameters:
  • url (str) –

  • session (Optional[requests.Session]) –

  • timeout (int) –

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

Return type:

Dict[str, Any]

async close()
Return type:

None

async __aenter__()
Return type:

BigqueryBase

async __aexit__(*args)
Parameters:

args (Any) –

Return type:

None