class_docstr: This handler handles connection and execution of the Airtable statements.
class_docstr_tok: ["This","handler","handles","connection","and","execution","of","the","Airtable","statements","."]
docstr: Set up the connection required by the handler.
  Returns:
      HandlerStatusResponse
docstr_tok: ["Set","up","the","connection","required","by","the","handler",".","Returns",":","HandlerStatusResponse"]
code: def connect(self) -> StatusResponse:
      """
      Set up the connection required by the handler.
      Returns:
          HandlerStatusResponse
      """
  
      if self.is_connected is True:
          return self.connection
  
      url = f"https://api.airtable.com/v0/{self.connection_data['base_id']}/{self.connection_data['table_name']}"
      headers = {
          "Authorization": "Bearer " + self.connection_data["api_key"]
      }
  
      response = requests.get(url, headers=headers)
      response = response.json()
      records = response["records"]
  
      new_records = True
      while new_records:
          try:
              if response["offset"]:
                  params = {"offset": response["offset"]}
                  response = requests.get(
                      url, params=params, headers=headers
                  )
                  response = response.json()
  
                  new_records = response["records"]
                  records = records + new_records
          except Exception:
              new_records = False
  
      rows = [record["fields"] for record in records]
      globals()[self.connection_data["table_name"]] = pd.DataFrame(rows)
  
      self.connection = duckdb.connect()
      self.is_connected = True
  
      return self.connection
  
imports: from typing import Optional
  from collections import OrderedDict
  import pandas
  import requests
  import duckdb
  from mindsdb_sql import parse_sql
  from mindsdb.integrations.libs.base import DatabaseHandler
  from mindsdb_sql.parser.ast.base import ASTNode
  from mindsdb.utilities import log
  from mindsdb.integrations.libs.response import HandlerStatusResponse, HandlerResponse, RESPONSE_TYPE
  from mindsdb.integrations.libs.const import HANDLER_CONNECTION_ARG_TYPE
label_desc: Use image node_id 3 for calling the AirtableHandler obj's underlying member method code with example usage: obj.connect() and returns: self, self