class_docstr: Interact with Weaviate database to store vectors. This hook uses the 'conn_id'.
  
  :param conn_id: The connection id to use when connecting to Weaviate. <howto/connection:weaviate>
class_docstr_tok: ["Interact","with","Weaviate","database","to","store","vectors",".","This","hook","uses","the","'conn_id","'",".",":","param","conn_id",":","The","connection","id","to","use","when","connecting","to","Weaviate",".","<","howto\/connection",":","weaviate",">"]
code: def get_conn(self) -> WeaviateClient:
      conn = self.get_connection(self.conn_id)
      url = conn.host
      username = conn.login or ""
      password = conn.password or ""
      extras = conn.extra_dejson
      access_token = extras.get("access_token", None)
      refresh_token = extras.get("refresh_token", None)
      expires_in = extras.get("expires_in", 60)
      # previously token was used as api_key(backwards compatibility)
      api_key = extras.get("api_key", None) or extras.get("token", None)
      client_secret = extras.get("client_secret", None)
      additional_headers = extras.pop("additional_headers", {})
      scope = extras.get("scope", None) or extras.get(
          "oidc_scope", None
      )
      if api_key:
          auth_client_secret = AuthApiKey(api_key)
      elif access_token:
          auth_client_secret = AuthBearerToken(
              access_token,
              expires_in=expires_in,
              refresh_token=refresh_token,
          )
      elif client_secret:
          auth_client_secret = AuthClientCredentials(
              client_secret=client_secret, scope=scope
          )
      else:
          auth_client_secret = AuthClientPassword(
              username=username, password=password, scope=scope
          )
  
      return WeaviateClient(
          url=url,
          auth_client_secret=auth_client_secret,
          additional_headers=additional_headers,
      )
  
imports: from __future__ import annotations
  import contextlib
  import json
  import warnings
  from functools import cached_property
  from typing import TYPE_CHECKING, Any, Dict, List, Sequence, cast
  import requests
  import weaviate.exceptions
  from tenacity import Retrying, retry, retry_if_exception, retry_if_exception_type, stop_after_attempt
  from weaviate import Client
  from weaviate.auth import AuthApiKey, AuthBearerToken, AuthClientCredentials, AuthClientPassword
  from weaviate.data.replication import ConsistencyLevel
  from weaviate.exceptions import ObjectAlreadyExistsException
  from weaviate.util import generate_uuid5
  from airflow.exceptions import AirflowProviderDeprecationWarning
  from airflow.hooks.base import BaseHook
label_desc: Use image node_id 4 for calling the WeaviateHook obj's underlying member method code with example usage: obj.get_conn() and returns: WeaviateClient