code: def convert_query_to_sql_statement(query):
      
      context = query._compile_context()
      context.statement.use_labels = False
      return context.statement
docs: Convert a Query object created from orm query, into executable sql statement.
  
      :param query: :class:`sqlalchemy.orm.Query`
  
      :return: :class:`sqlalchemy.sql.selectable.Select`