class_docstr: Hook for Google Cloud Vertex AI Auto ML APIs.
class_docstr_tok: ["Hook","for","Google","Cloud","Vertex","AI","Auto","ML","APIs","."]
docstr: Waits for long-lasting operation to complete.
docstr_tok: ["Waits","for","long-lasting","operation","to","complete","."]
code: def wait_for_operation(
      self, operation: Operation, timeout: float | None = None
  ):
      """Waits for long-lasting operation to complete."""
      try:
          return operation.result(timeout=timeout)
      except Exception:
          error = operation.exception(timeout=timeout)
          raise AirflowException(error)
  
imports: from __future__ import annotations
  import warnings
  from typing import TYPE_CHECKING, Sequence
  from google.api_core.client_options import ClientOptions
  from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
  from google.cloud.aiplatform import AutoMLForecastingTrainingJob, AutoMLImageTrainingJob, AutoMLTabularTrainingJob, AutoMLTextTrainingJob, AutoMLVideoTrainingJob, datasets, models
  from google.cloud.aiplatform_v1 import JobServiceClient, PipelineServiceClient
  from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
  from airflow.providers.google.common.hooks.base_google import GoogleBaseHook
label_desc: Use image node_id 11 for calling the AutoMLHook obj's underlying member method code with example usage: obj.wait_for_operation(operation, timeout) and returns: operation