MCPcopy Index your code
hub / github.com/sqlalchemy/sqlalchemy / expand_column_list_from_order_by

Function expand_column_list_from_order_by

lib/sqlalchemy/sql/util.py:429–443  ·  view source on GitHub ↗

Given the columns clause and ORDER BY of a selectable, return a list of column expressions that can be added to the collist corresponding to the ORDER BY, without repeating those already in the collist.

(collist, order_by)

Source from the content-addressed store, hash-verified

427
428
429def expand_column_list_from_order_by(collist, order_by):
430 """Given the columns clause and ORDER BY of a selectable,
431 return a list of column expressions that can be added to the collist
432 corresponding to the ORDER BY, without repeating those already
433 in the collist.
434
435 """
436 cols_already_present = {
437 col.element if col._order_by_label_element is not None else col
438 for col in collist
439 }
440
441 to_look_for = list(chain(*[unwrap_order_by(o) for o in order_by]))
442
443 return [col for col in to_look_for if col not in cols_already_present]
444
445
446def clause_is_present(clause, search):

Callers

nothing calls this directly

Calls 1

unwrap_order_byFunction · 0.85

Tested by

no test coverage detected