tfx.extensions.google_cloud_big_query.pusher.executor.Executor

Deploy a model to BigQuery ML for serving.

Inherits From: Executor, BaseExecutor

Child Classes

class Context

Methods

CheckBlessing

View source

Check that model is blessed by upstream validators.

Args
input_dict Input dict from input key to a list of artifacts:

  • model_blessing: A ModelBlessing artifact from model validator or evaluator. Pusher looks for a custom property blessed in the artifact to check it is safe to push.
  • infra_blessing: An InfraBlessing artifact from infra validator. Pusher looks for a custom proeprty blessed in the artifact to determine whether the model is mechanically servable from the model server to which Pusher is going to push.

Returns
True if the model is blessed by validator.

Do

View source

Overrides the tfx_pusher_executor.

Args
input_dict Input dict from input key to a list of artifacts, including:

  • model_export: exported model from trainer.
  • model_blessing: model blessing path from evaluator.
output_dict Output dict from key to a list of artifacts, including:
  • model_push: A list of 'ModelPushPath' artifact of size one. It will include the model in this push execution if the model was pushed.
  • exec_properties Mostly a passthrough input dict for tfx.components.Pusher.executor. custom_config.bigquery_serving_args is consumed by this class. For the full set of parameters supported by Big Query ML, refer to https://cloud.google.com/bigquery-ml/

    Returns
    None

    Raises
    ValueError If bigquery_serving_args is not in exec_properties.custom_config. If pipeline_root is not 'gs://...'
    RuntimeError if the Big Query job failed.