                          True))
          result = []
          seen = set()
  
          for expr, is_ref in order_by:
              resolved = expr.resolve_expression(self.query, allow_joins=True, reuse=None)
              if self.query.combinator and self.select:
                  src = resolved.get_source_expressions()[0]
                  expr_src = expr.get_source_expressions()[0]
                  # Relabel order by columns to raw numbers if this is a combined
 
</s> remove                     order_by.extend(self.find_ordering_name(
                        field, self.query.get_meta(), default_order=asc,
                    ))
            else:
                if col not in self.query.extra_select:
                    order_by.append((
                        OrderBy(RawSQL(*self.query.extra[col]), descending=descending),
                        False))
                else:
                    order_by.append((
                        OrderBy(Ref(col, RawSQL(*self.query.extra[col])), descending=descending),
                        True))
 </s> add                     yield from self.find_ordering_name(
                        field, self.query.get_meta(), default_order=default_order,
                    )

    def get_order_by(self):
        """
        Return a list of 2-tuples of the form (expr, (sql, params, is_ref)) for
        the ORDER BY clause.

        The order_by clause can alter the select clause (for example it can add
        aliases to clauses that do not yet have one, or it can add totally new
        select clauses).
        """ </s> remove                     order_by.append((OrderBy(F(col), descending=descending), False))
 </s> add                     yield OrderBy(F(col), descending=descending), False
        for expr, is_ref in self._order_by_pairs():
                          True))
          result = []
          seen = set()
  
        for expr, is_ref in self._order_by_pairs():
              resolved = expr.resolve_expression(self.query, allow_joins=True, reuse=None)
              if self.query.combinator and self.select:
                  src = resolved.get_source_expressions()[0]
                  expr_src = expr.get_source_expressions()[0]
                  # Relabel order by columns to raw numbers if this is a combined
keep keep keep keep replace keep keep keep keep keep
 Fixed #32662 -- Refactored a generator out of SQLCompiler.get_order_by().

This also renames the `asc` variable to `default_order`, markes the
`desc` variable as unused, fixes a typo in SQLCompiler.get_order_by()
docstring, and reorders some blocks in SQLCompiler._order_by_pairs(). 
django/db/models/sql/compiler.py