class_docstr: This handler handles connection and execution of the Scylla statements.
class_docstr_tok: ["This","handler","handles","connection","and","execution","of","the","Scylla","statements","."]
docstr: Handles the connection to a Scylla keystore.
docstr_tok: ["Handles","the","connection","to","a","Scylla","keystore","."]
code: def connect(self):
      """
      Handles the connection to a Scylla keystore.
      """
      if self.is_connected is True:
          return self.session
  
      auth_provider = PlainTextAuthProvider(
          username=self.connection_args["user"],
          password=self.connection_args["password"],
      )
  
      connection_props = {"auth_provider": auth_provider}
      connection_props["protocol_version"] = self.connection_args.get(
          "protocol_version", 4
      )
      secure_connect_bundle = self.connection_args.get(
          "secure_connect_bundle"
      )
  
      if secure_connect_bundle:
          # Check if the secure bundle is a URL
          if secure_connect_bundle.startswith(("http://", "https://")):
              secure_connect_bundle = self.download_secure_bundle(
                  secure_connect_bundle
              )
          connection_props["cloud"] = {
              "secure_connect_bundle": secure_connect_bundle
          }
      else:
          connection_props["contact_points"] = [
              self.connection_args["host"]
          ]
          connection_props["port"] = int(self.connection_args["port"])
  
      cluster = Cluster(**connection_props)
      session = cluster.connect(self.connection_args.get("keyspace"))
  
      self.is_connected = True
      self.session = session
      return self.session
  
imports: import os
  import tempfile
  from collections import OrderedDict
  import pandas
  import requests
  from cassandra.cluster import Cluster
  from cassandra.auth import PlainTextAuthProvider
  from cassandra.util import Date
  from mindsdb_sql import parse_sql
  from mindsdb_sql.parser.ast.base import ASTNode
  from mindsdb_sql.parser import ast
  from mindsdb_sql.render.sqlalchemy_render import SqlalchemyRender
  from mindsdb.integrations.libs.const import HANDLER_CONNECTION_ARG_TYPE
  from mindsdb.integrations.libs.base import DatabaseHandler
  from mindsdb.integrations.libs.response import HandlerStatusResponse, HandlerResponse, RESPONSE_TYPE
  from mindsdb.utilities import log
label_desc: Use image node_id 3 for calling the ScyllaHandler obj's underlying member method code with example usage: obj.connect() and returns: self, self