MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / mark_exclude_cols

Method mark_exclude_cols

lib/sqlalchemy/orm/relationships.py:3306–3334  ·  view source on GitHub ↗

note unrelated columns in the "extra criteria" as either should be adapted or not adapted, even though they are not part of our "local" or "remote" side. see #9779 for this case, as well as #11010 for a follow up

(
                elem: SupportsAnnotations, annotations: _AnnotationDict
            )

Source from the content-addressed store, hash-verified

3304 if extra_criteria:
3305
3306 def mark_exclude_cols(
3307 elem: SupportsAnnotations, annotations: _AnnotationDict
3308 ) -> SupportsAnnotations:
3309 """note unrelated columns in the "extra criteria" as either
3310 should be adapted or not adapted, even though they are not
3311 part of our "local" or "remote" side.
3312
3313 see #9779 for this case, as well as #11010 for a follow up
3314
3315 """
3316
3317 parentmapper_for_element = elem._annotations.get(
3318 "parentmapper", None
3319 )
3320
3321 if (
3322 # NOTE: it's not clear yet if this needs to test for
3323 # parentmapper_for_element.isa(self.prop.parent). so far
3324 # we have not come up with a test.
3325 parentmapper_for_element is not self.prop.parent
3326 and (
3327 parentmapper_for_element is None
3328 or not parentmapper_for_element.isa(self.prop.mapper)
3329 )
3330 and elem not in self._secondary_lineage_set
3331 ):
3332 return _safe_annotate(elem, annotations)
3333 else:
3334 return elem
3335
3336 extra_criteria = tuple(
3337 _deep_annotate(

Callers

nothing calls this directly

Calls 3

_safe_annotateFunction · 0.85
isaMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected