prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  [BUG] Fix scylladb error when connecting with secure bundle
  When connecting with `secure_connect_bundle` users got unknown secure_connect_bundle path error.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `mindsdb/integrations/handlers/scylla_handler/scylla_handler.py`
  Content:
  ```
  1 import os
  2 from mindsdb.integrations.libs.base_handler import DatabaseHandler
  3 from mindsdb_sql import parse_sql
  4 from mindsdb_sql.render.sqlalchemy_render import SqlalchemyRender
  5 from cassandra.cluster import Cluster
  6 from cassandra.auth import PlainTextAuthProvider
  7 from mindsdb.integrations.libs.response import (
  8     HandlerStatusResponse as StatusResponse,
  9     HandlerResponse as Response,
  10     RESPONSE_TYPE
  11 )
  12 from mindsdb.utilities.log import log
  13 import pandas as pd
  14 from mindsdb_sql.parser.ast.base import ASTNode
  15 
  16 
  17 class ScyllaHandler(DatabaseHandler):
  18     """
  19     This handler handles connection and execution of the Scylla statements.
  20     """
  21     name = 'scylla'
  22 
  23     def __init__(self, name=None, **kwargs):
  24         super().__init__(name)
  25         self.parser = parse_sql
  26         self.connection_args = kwargs.get('connection_data')
  27         self.session = None
  28         self.is_connected = False
  29 
  30     def connect(self):
  31         """
  32         Handles the connection to a Scylla keystore.
  33         """
  34         if self.is_connected is True:
  35             return self.session
  36 
  37         auth_provider = PlainTextAuthProvider(
  38             username=self.connection_args['user'], password=self.connection_args['password']
  39         )
  40 
  41         connection_props = {
  42             'auth_provider': auth_provider
  43         }
  44 
  45         if self.connection_args['protocol_version'] is not None:
  46             connection_props['protocol_version'] = self.connection_args['protocol_version']
  47  
  48         secure_connect_bundle = self.connection_args.get('secure_connect_bundle')
  49 
  50         if secure_connect_bundle is not None:
  51             if os.path.isfile(self.secure_connect_bundle) is False:
  52                 raise Exception("Secure_connect_bundle' must be path to the file")
  53             connection_props['cloud'] = {
  54                 'secure_connect_bundle': self.secure_connect_bundle
  55             }
  56         else:
  57             connection_props['contact_points'] = [self.connection_args['host']]
  58             connection_props['port'] = int(self.connection_args['port'])
  59 
  60         cluster = Cluster(**connection_props)
  61         session = cluster.connect(self.connection_args['keyspace'])
  62 
  63         self.is_connected = True
  64         self.session = session
  65         return self.session
  66 
  67     def check_connection(self) -> StatusResponse:
  68         """
  69         Check the connection of the Scylla database
  70         :return: success status and error message if error occurs
  71         """
  72         response = StatusResponse(False)
  73 
  74         try:
  75             session = self.connect()
  76             # TODO: change the healthcheck
  77             session.execute('SELECT release_version FROM system.local').one()
  78             response.success = True
  79         except Exception as e:
  80             log.error(f'Error connecting to Scylla {self.connection_args["keyspace"]}, {e}!')
  81             response.error_message = e
  82 
  83         if response.success is False and self.is_connected is True:
  84             self.is_connected = False
  85 
  86         return response
  87 
  88     def native_query(self, query: str) -> Response:
  89         """
  90         Receive SQL query and runs it
  91         :param query: The SQL query to run in MySQL
  92         :return: returns the records from the current recordset
  93         """
  94         session = self.connect()
  95         try:
  96             resp = session.execute(query).all()
  97             if resp:
  98                 response = Response(
  99                     RESPONSE_TYPE.TABLE,
  100                     pd.DataFrame(
  101                         resp
  102                     )
  103                 )
  104             else:
  105                 response = Response(RESPONSE_TYPE.OK)
  106         except Exception as e:
  107             log.error(f'Error running query: {query} on {self.connection_args["keyspace"]}!')
  108             response = Response(
  109                 RESPONSE_TYPE.ERROR,
  110                 error_message=str(e)
  111             )
  112         return response
  113 
  114     def query(self, query: ASTNode) -> Response:
  115         """
  116         Retrieve the data from the SQL statement.
  117         """
  118         renderer = SqlalchemyRender('mysql')
  119         query_str = renderer.get_string(query, with_failback=True)
  120         return self.native_query(query_str)
  121 
  122     def get_tables(self) -> Response:
  123         """
  124         Get a list with all of the tabels in MySQL
  125         """
  126         q = "DESCRIBE TABLES;"
  127         result = self.native_query(q)
  128         df = result.data_frame
  129         result.data_frame = df.rename(columns={df.columns[0]: 'table_name'})
  130         return result
  131 
  132     def get_columns(self, table_name) -> Response:
  133         """
  134         Show details about the table
  135         """
  136         q = f"DESCRIBE {table_name};"
  137         result = self.native_query(q)
  138         return result
  139
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/mindsdb/integrations/handlers/scylla_handler/scylla_handler.py b/mindsdb/integrations/handlers/scylla_handler/scylla_handler.py
  --- a/mindsdb/integrations/handlers/scylla_handler/scylla_handler.py
  +++ b/mindsdb/integrations/handlers/scylla_handler/scylla_handler.py
  @@ -41,24 +41,21 @@
           connection_props = {
               'auth_provider': auth_provider
           }
  -
  -        if self.connection_args['protocol_version'] is not None:
  -            connection_props['protocol_version'] = self.connection_args['protocol_version']
  - 
  +        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 is not None:
  -            if os.path.isfile(self.secure_connect_bundle) is False:
  +            if os.path.isfile(secure_connect_bundle) is False:
                   raise Exception("Secure_connect_bundle' must be path to the file")
               connection_props['cloud'] = {
  -                'secure_connect_bundle': self.secure_connect_bundle
  +                '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['keyspace'])
  +        session = cluster.connect(self.connection_args.get('keyspace'))
   
           self.is_connected = True
           self.session = session
  
verification_info: {"golden_diff": "diff --git a/mindsdb/integrations/handlers/scylla_handler/scylla_handler.py b/mindsdb/integrations/handlers/scylla_handler/scylla_handler.py\n--- a/mindsdb/integrations/handlers/scylla_handler/scylla_handler.py\n+++ b/mindsdb/integrations/handlers/scylla_handler/scylla_handler.py\n@@ -41,24 +41,21 @@\n         connection_props = {\n             'auth_provider': auth_provider\n         }\n-\n-        if self.connection_args['protocol_version'] is not None:\n-            connection_props['protocol_version'] = self.connection_args['protocol_version']\n- \n+        connection_props['protocol_version'] = self.connection_args.get('protocol_version', 4)\n         secure_connect_bundle = self.connection_args.get('secure_connect_bundle')\n \n         if secure_connect_bundle is not None:\n-            if os.path.isfile(self.secure_connect_bundle) is False:\n+            if os.path.isfile(secure_connect_bundle) is False:\n                 raise Exception(\"Secure_connect_bundle' must be path to the file\")\n             connection_props['cloud'] = {\n-                'secure_connect_bundle': self.secure_connect_bundle\n+                'secure_connect_bundle': secure_connect_bundle\n             }\n         else:\n             connection_props['contact_points'] = [self.connection_args['host']]\n             connection_props['port'] = int(self.connection_args['port'])\n \n         cluster = Cluster(**connection_props)\n-        session = cluster.connect(self.connection_args['keyspace'])\n+        session = cluster.connect(self.connection_args.get('keyspace'))\n \n         self.is_connected = True\n         self.session = session\n", "issue": "[BUG] Fix scylladb error when connecting with secure bundle\nWhen connecting with `secure_connect_bundle` users got unknown secure_connect_bundle path error.\n", "before_files": [{"content": "import os\nfrom mindsdb.integrations.libs.base_handler import DatabaseHandler\nfrom mindsdb_sql import parse_sql\nfrom mindsdb_sql.render.sqlalchemy_render import SqlalchemyRender\nfrom cassandra.cluster import Cluster\nfrom cassandra.auth import PlainTextAuthProvider\nfrom mindsdb.integrations.libs.response import (\n    HandlerStatusResponse as StatusResponse,\n    HandlerResponse as Response,\n    RESPONSE_TYPE\n)\nfrom mindsdb.utilities.log import log\nimport pandas as pd\nfrom mindsdb_sql.parser.ast.base import ASTNode\n\n\nclass ScyllaHandler(DatabaseHandler):\n    \"\"\"\n    This handler handles connection and execution of the Scylla statements.\n    \"\"\"\n    name = 'scylla'\n\n    def __init__(self, name=None, **kwargs):\n        super().__init__(name)\n        self.parser = parse_sql\n        self.connection_args = kwargs.get('connection_data')\n        self.session = None\n        self.is_connected = False\n\n    def connect(self):\n        \"\"\"\n        Handles the connection to a Scylla keystore.\n        \"\"\"\n        if self.is_connected is True:\n            return self.session\n\n        auth_provider = PlainTextAuthProvider(\n            username=self.connection_args['user'], password=self.connection_args['password']\n        )\n\n        connection_props = {\n            'auth_provider': auth_provider\n        }\n\n        if self.connection_args['protocol_version'] is not None:\n            connection_props['protocol_version'] = self.connection_args['protocol_version']\n \n        secure_connect_bundle = self.connection_args.get('secure_connect_bundle')\n\n        if secure_connect_bundle is not None:\n            if os.path.isfile(self.secure_connect_bundle) is False:\n                raise Exception(\"Secure_connect_bundle' must be path to the file\")\n            connection_props['cloud'] = {\n                'secure_connect_bundle': self.secure_connect_bundle\n            }\n        else:\n            connection_props['contact_points'] = [self.connection_args['host']]\n            connection_props['port'] = int(self.connection_args['port'])\n\n        cluster = Cluster(**connection_props)\n        session = cluster.connect(self.connection_args['keyspace'])\n\n        self.is_connected = True\n        self.session = session\n        return self.session\n\n    def check_connection(self) -> StatusResponse:\n        \"\"\"\n        Check the connection of the Scylla database\n        :return: success status and error message if error occurs\n        \"\"\"\n        response = StatusResponse(False)\n\n        try:\n            session = self.connect()\n            # TODO: change the healthcheck\n            session.execute('SELECT release_version FROM system.local').one()\n            response.success = True\n        except Exception as e:\n            log.error(f'Error connecting to Scylla {self.connection_args[\"keyspace\"]}, {e}!')\n            response.error_message = e\n\n        if response.success is False and self.is_connected is True:\n            self.is_connected = False\n\n        return response\n\n    def native_query(self, query: str) -> Response:\n        \"\"\"\n        Receive SQL query and runs it\n        :param query: The SQL query to run in MySQL\n        :return: returns the records from the current recordset\n        \"\"\"\n        session = self.connect()\n        try:\n            resp = session.execute(query).all()\n            if resp:\n                response = Response(\n                    RESPONSE_TYPE.TABLE,\n                    pd.DataFrame(\n                        resp\n                    )\n                )\n            else:\n                response = Response(RESPONSE_TYPE.OK)\n        except Exception as e:\n            log.error(f'Error running query: {query} on {self.connection_args[\"keyspace\"]}!')\n            response = Response(\n                RESPONSE_TYPE.ERROR,\n                error_message=str(e)\n            )\n        return response\n\n    def query(self, query: ASTNode) -> Response:\n        \"\"\"\n        Retrieve the data from the SQL statement.\n        \"\"\"\n        renderer = SqlalchemyRender('mysql')\n        query_str = renderer.get_string(query, with_failback=True)\n        return self.native_query(query_str)\n\n    def get_tables(self) -> Response:\n        \"\"\"\n        Get a list with all of the tabels in MySQL\n        \"\"\"\n        q = \"DESCRIBE TABLES;\"\n        result = self.native_query(q)\n        df = result.data_frame\n        result.data_frame = df.rename(columns={df.columns[0]: 'table_name'})\n        return result\n\n    def get_columns(self, table_name) -> Response:\n        \"\"\"\n        Show details about the table\n        \"\"\"\n        q = f\"DESCRIBE {table_name};\"\n        result = self.native_query(q)\n        return result\n", "path": "mindsdb/integrations/handlers/scylla_handler/scylla_handler.py"}], "after_files": [{"content": "import os\nfrom mindsdb.integrations.libs.base_handler import DatabaseHandler\nfrom mindsdb_sql import parse_sql\nfrom mindsdb_sql.render.sqlalchemy_render import SqlalchemyRender\nfrom cassandra.cluster import Cluster\nfrom cassandra.auth import PlainTextAuthProvider\nfrom mindsdb.integrations.libs.response import (\n    HandlerStatusResponse as StatusResponse,\n    HandlerResponse as Response,\n    RESPONSE_TYPE\n)\nfrom mindsdb.utilities.log import log\nimport pandas as pd\nfrom mindsdb_sql.parser.ast.base import ASTNode\n\n\nclass ScyllaHandler(DatabaseHandler):\n    \"\"\"\n    This handler handles connection and execution of the Scylla statements.\n    \"\"\"\n    name = 'scylla'\n\n    def __init__(self, name=None, **kwargs):\n        super().__init__(name)\n        self.parser = parse_sql\n        self.connection_args = kwargs.get('connection_data')\n        self.session = None\n        self.is_connected = False\n\n    def connect(self):\n        \"\"\"\n        Handles the connection to a Scylla keystore.\n        \"\"\"\n        if self.is_connected is True:\n            return self.session\n\n        auth_provider = PlainTextAuthProvider(\n            username=self.connection_args['user'], password=self.connection_args['password']\n        )\n\n        connection_props = {\n            'auth_provider': auth_provider\n        }\n        connection_props['protocol_version'] = self.connection_args.get('protocol_version', 4)\n        secure_connect_bundle = self.connection_args.get('secure_connect_bundle')\n\n        if secure_connect_bundle is not None:\n            if os.path.isfile(secure_connect_bundle) is False:\n                raise Exception(\"Secure_connect_bundle' must be path to the file\")\n            connection_props['cloud'] = {\n                'secure_connect_bundle': secure_connect_bundle\n            }\n        else:\n            connection_props['contact_points'] = [self.connection_args['host']]\n            connection_props['port'] = int(self.connection_args['port'])\n\n        cluster = Cluster(**connection_props)\n        session = cluster.connect(self.connection_args.get('keyspace'))\n\n        self.is_connected = True\n        self.session = session\n        return self.session\n\n    def check_connection(self) -> StatusResponse:\n        \"\"\"\n        Check the connection of the Scylla database\n        :return: success status and error message if error occurs\n        \"\"\"\n        response = StatusResponse(False)\n\n        try:\n            session = self.connect()\n            # TODO: change the healthcheck\n            session.execute('SELECT release_version FROM system.local').one()\n            response.success = True\n        except Exception as e:\n            log.error(f'Error connecting to Scylla {self.connection_args[\"keyspace\"]}, {e}!')\n            response.error_message = e\n\n        if response.success is False and self.is_connected is True:\n            self.is_connected = False\n\n        return response\n\n    def native_query(self, query: str) -> Response:\n        \"\"\"\n        Receive SQL query and runs it\n        :param query: The SQL query to run in MySQL\n        :return: returns the records from the current recordset\n        \"\"\"\n        session = self.connect()\n        try:\n            resp = session.execute(query).all()\n            if resp:\n                response = Response(\n                    RESPONSE_TYPE.TABLE,\n                    pd.DataFrame(\n                        resp\n                    )\n                )\n            else:\n                response = Response(RESPONSE_TYPE.OK)\n        except Exception as e:\n            log.error(f'Error running query: {query} on {self.connection_args[\"keyspace\"]}!')\n            response = Response(\n                RESPONSE_TYPE.ERROR,\n                error_message=str(e)\n            )\n        return response\n\n    def query(self, query: ASTNode) -> Response:\n        \"\"\"\n        Retrieve the data from the SQL statement.\n        \"\"\"\n        renderer = SqlalchemyRender('mysql')\n        query_str = renderer.get_string(query, with_failback=True)\n        return self.native_query(query_str)\n\n    def get_tables(self) -> Response:\n        \"\"\"\n        Get a list with all of the tabels in MySQL\n        \"\"\"\n        q = \"DESCRIBE TABLES;\"\n        result = self.native_query(q)\n        df = result.data_frame\n        result.data_frame = df.rename(columns={df.columns[0]: 'table_name'})\n        return result\n\n    def get_columns(self, table_name) -> Response:\n        \"\"\"\n        Show details about the table\n        \"\"\"\n        q = f\"DESCRIBE {table_name};\"\n        result = self.native_query(q)\n        return result\n", "path": "mindsdb/integrations/handlers/scylla_handler/scylla_handler.py"}]}