MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _shallow_annotate

Function _shallow_annotate

lib/sqlalchemy/sql/annotation.py:525–535  ·  view source on GitHub ↗

Annotate the given ClauseElement and copy its internals so that internal objects refer to the new annotated object. Basically used to apply a "don't traverse" annotation to a selectable, without digging throughout the whole structure wasting time.

(element: _SA, annotations: _AnnotationDict)

Source from the content-addressed store, hash-verified

523
524
525def _shallow_annotate(element: _SA, annotations: _AnnotationDict) -> _SA:
526 """Annotate the given ClauseElement and copy its internals so that
527 internal objects refer to the new annotated object.
528
529 Basically used to apply a "don't traverse" annotation to a
530 selectable, without digging throughout the whole
531 structure wasting time.
532 """
533 element = element._annotate(annotations)
534 element._copy_internals(_annotations_traversal=True)
535 return element
536
537
538def _new_annotation_type(

Callers 1

join_targetsMethod · 0.85

Calls 2

_annotateMethod · 0.45
_copy_internalsMethod · 0.45

Tested by

no test coverage detected