code: def __init__(self, sql, session, execute=True):
      self.session = session
  
      self.context = {
          "database": None
          if session.database == ""
          else session.database.lower(),
          "row_id": 0,
      }
  
      self.columns_list = None
      self.steps_data = []
  
      self.planner = None
      self.parameters = []
      self.fetched_data = None
  
      self.outer_query = None
  
      if isinstance(sql, str):
          # region workaround for subqueries in superset
          if "as virtual_table" in sql.lower():
              subquery = re.findall(superset_subquery, sql)
              if isinstance(subquery, list) and len(subquery) == 1:
                  subquery = subquery[0]
                  self.outer_query = sql.replace(subquery, "dataframe")
                  sql = subquery.strip("()")
          # endregion
          self.query = parse_sql(sql, dialect="mindsdb")
          self.context["query_str"] = sql
      else:
          self.query = sql
          renderer = SqlalchemyRender("mysql")
          try:
              self.context["query_str"] = renderer.get_string(
                  self.query, with_failback=True
              )
          except Exception:
              self.context["query_str"] = str(self.query)
  
      self.create_planner()
  
      if execute:
          self.prepare_query(prepare=False)
          self.execute_query()
  
imports: import inspect
  import re
  from mindsdb_sql import parse_sql
  from mindsdb_sql.parser.ast import Identifier
  from mindsdb_sql.planner.steps import ApplyTimeseriesPredictorStep, ApplyPredictorRowStep, ApplyPredictorStep
  from mindsdb_sql.exceptions import PlanningException
  from mindsdb_sql.render.sqlalchemy_render import SqlalchemyRender
  from mindsdb_sql.planner import query_planner
  from mindsdb_sql.planner.utils import query_traversal
  from mindsdb.api.executor.utilities.sql import query_df
  from mindsdb.interfaces.model.functions import get_model_record
  from mindsdb.api.executor.exceptions import UnknownError, LogicError
  import mindsdb.utilities.profiler
  from mindsdb.utilities.fs import create_process_mark, delete_process_mark
  from .None import steps
  from .result_set import ResultSet, Column
  from .steps.base import BaseStepCall
label_desc: Use image node_id 1 to create a new SQLQuery object  with example: obj = SQLQuery(sql, session, execute)