MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / mark_exclude_cols

Method mark_exclude_cols

lib/sqlalchemy/orm/relationships.py:3389–3417  ·  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

3387 if extra_criteria:
3388
3389 def mark_exclude_cols(
3390 elem: SupportsAnnotations, annotations: _AnnotationDict
3391 ) -> SupportsAnnotations:
3392 """note unrelated columns in the "extra criteria" as either
3393 should be adapted or not adapted, even though they are not
3394 part of our "local" or "remote" side.
3395
3396 see #9779 for this case, as well as #11010 for a follow up
3397
3398 """
3399
3400 parentmapper_for_element = elem._annotations.get(
3401 "parentmapper", None
3402 )
3403
3404 if (
3405 # NOTE: it's not clear yet if this needs to test for
3406 # parentmapper_for_element.isa(self.prop.parent). so far
3407 # we have not come up with a test.
3408 parentmapper_for_element is not self.prop.parent
3409 and (
3410 parentmapper_for_element is None
3411 or not parentmapper_for_element.isa(self.prop.mapper)
3412 )
3413 and elem not in self._secondary_lineage_set
3414 ):
3415 return _safe_annotate(elem, annotations)
3416 else:
3417 return elem
3418
3419 extra_criteria = tuple(
3420 _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