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.model.ModelReference

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

ModelReferences are pointers to models.

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

__init__()[source]

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

Methods

__init__()

Initialize self.

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

property dataset_id

ID of dataset containing the model.

Type

str

classmethod from_api_repr(resource: Dict[str, Any])google.cloud.bigquery.model.ModelReference[source]

Factory: construct a model reference given its API representation.

Parameters

resource – Model reference representation returned from the API

Returns

Model reference parsed from resource.

classmethod from_string(model_id: str, default_project: Optional[str] = None)google.cloud.bigquery.model.ModelReference[source]

Construct a model reference from model ID string.

Parameters
  • model_id – 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 – The project ID to use when model_id does not include a project ID.

Returns

Model reference parsed from model_id.

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: str

URL path for the model’s APIs.

property project

Project bound to the model

Type

str

to_api_repr()Dict[str, Any][source]

Construct the API resource representation of this model reference.

Returns

Model reference represented as an API resource.