code: def _handle_deferrable_databricks_operator_completion(
      event: dict, log: Logger
  ) -> None:
      validate_trigger_event(event)
      run_state = RunState.from_json(event["run_state"])
      run_page_url = event["run_page_url"]
      log.info(
          "View run status, Spark UI, and logs at %s", run_page_url
      )
  
      if run_state.is_successful:
          log.info("Job run completed successfully.")
          return
      else:
          error_message = (
              f"Job run failed with terminal state: {run_state}"
          )
          raise AirflowException(error_message)
  
imports: from __future__ import annotations
  import time
  import warnings
  from functools import cached_property
  from logging import Logger
  from typing import TYPE_CHECKING, Any, Sequence
  from airflow.configuration import conf
  from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
  from airflow.models import BaseOperator, BaseOperatorLink, XCom
  from airflow.providers.databricks.hooks.databricks import DatabricksHook, RunState
  from airflow.providers.databricks.triggers.databricks import DatabricksExecutionTrigger
  from airflow.providers.databricks.utils.databricks import normalise_json_content, validate_trigger_event
label_desc: Use image node_id 3 for calling a global function with example usage: _handle_deferrable_databricks_operator_completion(event, log) without return types