google.cloud.bigquery.external_config.CSVOptions#

Methods

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.


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

Bases: object

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

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/jobs#configuration.query.tableDefinitions.(key).csvOptions.allowJaggedRows https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#externalDataConfiguration.csvOptions.allowJaggedRows

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/jobs#configuration.query.tableDefinitions.(key).csvOptions.allowQuotedNewlines https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#externalDataConfiguration.csvOptions.allowQuotedNewlines

Type

bool

property encoding#

The character encoding of the data.

See https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.query.tableDefinitions.(key).csvOptions.encoding https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#externalDataConfiguration.csvOptions.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/jobs#configuration.query.tableDefinitions.(key).csvOptions.fieldDelimiter https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#externalDataConfiguration.csvOptions.fieldDelimiter

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/jobs#configuration.query.tableDefinitions.(key).csvOptions.quote https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#externalDataConfiguration.csvOptions.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/jobs#configuration.query.tableDefinitions.(key).csvOptions.skipLeadingRows https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#externalDataConfiguration.csvOptions.skipLeadingRows

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]