(
compile_state,
mapper,
query_entity,
path,
adapter,
column_collection,
with_polymorphic=None,
only_load_props=None,
polymorphic_discriminator=None,
**kw,
)
| 750 | |
| 751 | |
| 752 | def _setup_entity_query( |
| 753 | compile_state, |
| 754 | mapper, |
| 755 | query_entity, |
| 756 | path, |
| 757 | adapter, |
| 758 | column_collection, |
| 759 | with_polymorphic=None, |
| 760 | only_load_props=None, |
| 761 | polymorphic_discriminator=None, |
| 762 | **kw, |
| 763 | ): |
| 764 | if with_polymorphic: |
| 765 | poly_properties = mapper._iterate_polymorphic_properties( |
| 766 | with_polymorphic |
| 767 | ) |
| 768 | else: |
| 769 | poly_properties = mapper._polymorphic_properties |
| 770 | |
| 771 | quick_populators = {} |
| 772 | |
| 773 | path.set(compile_state.attributes, "memoized_setups", quick_populators) |
| 774 | |
| 775 | # for the lead entities in the path, e.g. not eager loads, and |
| 776 | # assuming a user-passed aliased class, e.g. not a from_self() or any |
| 777 | # implicit aliasing, don't add columns to the SELECT that aren't |
| 778 | # in the thing that's aliased. |
| 779 | check_for_adapt = adapter and len(path) == 1 and path[-1].is_aliased_class |
| 780 | |
| 781 | for value in poly_properties: |
| 782 | if only_load_props and value.key not in only_load_props: |
| 783 | continue |
| 784 | value.setup( |
| 785 | compile_state, |
| 786 | query_entity, |
| 787 | path, |
| 788 | adapter, |
| 789 | only_load_props=only_load_props, |
| 790 | column_collection=column_collection, |
| 791 | memoized_populators=quick_populators, |
| 792 | check_for_adapt=check_for_adapt, |
| 793 | **kw, |
| 794 | ) |
| 795 | |
| 796 | if ( |
| 797 | polymorphic_discriminator is not None |
| 798 | and polymorphic_discriminator is not mapper.polymorphic_on |
| 799 | ): |
| 800 | if adapter: |
| 801 | pd = adapter.columns[polymorphic_discriminator] |
| 802 | else: |
| 803 | pd = polymorphic_discriminator |
| 804 | column_collection.append(pd) |
| 805 | |
| 806 | |
| 807 | def _warn_for_runid_changed(state): |
nothing calls this directly
no test coverage detected