As of January 1, 2020 this library no longer supports Python 2 on the latest released version. Library versions released prior to that date will continue to be available. For more information please visit Python 2 support on Google Cloud.

google.cloud.bigquery.external_config.CSVOptions

class google.cloud.bigquery.external_config.CSVOptions[source]

Options that describe how to treat CSV files as BigQuery tables.

__init__()[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__()

Initialize self.

from_api_repr(resource)

Factory: construct a CSVOptions instance given its API representation.

to_api_repr()

Build an API representation of this object.

Attributes

allow_jagged_rows

If True, BigQuery treats missing trailing columns as null values.

allow_quoted_newlines

If True, quoted data sections that contain newline characters in a CSV file are allowed.

encoding

The character encoding of the data.

field_delimiter

The separator for fields in a CSV file.

quote_character

The value that is used to quote data sections in a CSV file.

skip_leading_rows

The number of rows at the top of a CSV file.

property allow_jagged_rows

If True, BigQuery treats missing trailing columns as null values. Defaults to False.

See https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#CsvOptions.FIELDS.allow_jagged_rows

Type

bool

property allow_quoted_newlines

If True, quoted data sections that contain newline characters in a CSV file are allowed. Defaults to False.

See https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#CsvOptions.FIELDS.allow_quoted_newlines

Type

bool

property encoding

The character encoding of the data.

See https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#CsvOptions.FIELDS.encoding

Type

str

property field_delimiter

The separator for fields in a CSV file. Defaults to comma (‘,’).

See https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#CsvOptions.FIELDS.field_delimiter

Type

str

classmethod from_api_repr(resource)[source]

Factory: construct a CSVOptions instance given its API representation.

Parameters

resource (Dict[str, Any]) – Definition of a CSVOptions instance in the same representation as is returned from the API.

Returns

Configuration parsed from resource.

Return type

CSVOptions

property quote_character

The value that is used to quote data sections in a CSV file.

See https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#CsvOptions.FIELDS.quote

Type

str

property skip_leading_rows

The number of rows at the top of a CSV file.

See https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#CsvOptions.FIELDS.skip_leading_rows

Type

int

to_api_repr()[source]

Build an API representation of this object.

Returns

A dictionary in the format used by the BigQuery API.

Return type

Dict[str, Any]