google.cloud.bigquery.query.ScalarQueryParameter#

Methods

from_api_repr(resource)

Factory: construct parameter from JSON resource.

positional(type_, value)

Factory for positional paramater.

to_api_repr()

Construct JSON API representation for the parameter.


class google.cloud.bigquery.query.ScalarQueryParameter(name, type_, value)[source]#

Bases: google.cloud.bigquery.query._AbstractQueryParameter

Named / positional query parameters for scalar values.

Parameters
  • name (str or None) – Parameter name, used via @foo syntax. If None, the parameter can only be addressed via position (?).

  • type (str) – name of parameter type. One of ‘STRING’, ‘INT64’, ‘FLOAT64’, ‘NUMERIC’, ‘BOOL’, ‘TIMESTAMP’, ‘DATETIME’, or ‘DATE’.

  • value (str, int, float, decimal.Decimal, bool, datetime.datetime, or datetime.date.) – the scalar parameter value.

classmethod from_api_repr(resource)[source]#

Factory: construct parameter from JSON resource.

Parameters

resource (dict) – JSON mapping of parameter

Return type

ScalarQueryParameter

Returns

instance

classmethod positional(type_, value)[source]#

Factory for positional paramater.

Parameters
  • type (str) – name of parameter type. One of ‘STRING’, ‘INT64’, ‘FLOAT64’, ‘NUMERIC’, ‘BOOL’, ‘TIMESTAMP’, ‘DATETIME’, or ‘DATE’.

  • value (str, int, float, decimal.Decimal, bool, datetime.datetime, or datetime.date.) – the scalar parameter value.

Return type

ScalarQueryParameter

Returns

instance without name

to_api_repr()[source]#

Construct JSON API representation for the parameter.

Return type

dict

Returns

JSON mapping