                  if having:
                      result.append('HAVING %s' % having)
                      params.extend(h_params)
  
              if self.query.explain_query:
                  result.insert(0, self.connection.ops.explain_query_prefix(
                      self.query.explain_format,
                      **self.query.explain_options
                  ))
  
 
</s> remove                     self.query.explain_format,
                    **self.query.explain_options
 </s> add                     self.query.explain_info.format,
                    **self.query.explain_info.options </s> remove         output_formatter = json.dumps if self.query.explain_format == 'json' else str
 </s> add         output_formatter = json.dumps if self.query.explain_info.format == 'json' else str </s> remove         self.explain_query = False
        self.explain_format = None
        self.explain_options = {}
 </s> add         self.explain_info = None </s> remove         q.explain_query = True
        q.explain_format = format
        q.explain_options = options
 </s> add         q.explain_info = ExplainInfo(format, options)
            if self.query.explain_info:
                  if having:
                      result.append('HAVING %s' % having)
                      params.extend(h_params)
  
            if self.query.explain_info:
                  result.insert(0, self.connection.ops.explain_query_prefix(
                      self.query.explain_format,
                      **self.query.explain_options
                  ))
  
keep keep keep keep replace keep keep keep keep keep
 Refs #27624 -- Changed Query.explain_info to namedtuple. 
django/db/models/sql/compiler.py