google.cloud.bigquery.model.ModelReference#

Methods

from_api_repr(resource)

Factory: construct a model reference given its API representation

from_string(model_id[, default_project])

Construct a model reference from model ID string.

to_api_repr()

Construct the API resource representation of this model reference.

Attributes

dataset_id

ID of dataset containing the model.

model_id

The model ID.

path

URL path for the model’s APIs.

project

Project bound to the model


class google.cloud.bigquery.model.ModelReference[source]#

Bases: object

ModelReferences are pointers to models.

See https://cloud.google.com/bigquery/docs/reference/rest/v2/models

property dataset_id#

ID of dataset containing the model.

Type

str

classmethod from_api_repr(resource)[source]#

Factory: construct a model reference given its API representation

Parameters

resource (Dict[str, object]) – Model reference representation returned from the API

Returns

Model reference parsed from resource.

Return type

google.cloud.bigquery.model.ModelReference

classmethod from_string(model_id, default_project=None)[source]#

Construct a model reference from model ID string.

Parameters
  • model_id (str) – A model ID in standard SQL format. If default_project is not specified, this must included a project ID, dataset ID, and model ID, each separated by ..

  • default_project (str) – Optional. The project ID to use when model_id does not include a project ID.

Returns

Model reference parsed from model_id.

Return type

google.cloud.bigquery.model.ModelReference

Raises

ValueError – If model_id is not a fully-qualified table ID in standard SQL format.

property model_id#

The model ID.

Type

str

property path#

URL path for the model’s APIs.

Type

str

property project#

Project bound to the model

Type

str

to_api_repr()[source]#

Construct the API resource representation of this model reference.

Returns

Model reference represented as an API resource

Return type

Dict[str, object]