'Apply single-table-inheritance filtering.
For all distinct single-table-inheritance mappers represented in
the columns clause of this query, add criterion to the WHERE
clause of the given QueryContext such that only the appropriate
subtypes are selected from the total results.'

def _adjust_for_single_inheritance(self, context):

    for (ext_info, adapter) in self._mapper_adapter_map.values():
        if (ext_info in self._join_entities):
            continue
        single_crit = ext_info.mapper._single_table_criterion
        if (single_crit is not None):
            if adapter:
                single_crit = adapter.traverse(single_crit)
            single_crit = self._adapt_clause(single_crit, False, False)
            context.whereclause = sql.and_(sql.True_._ifnone(context.whereclause), single_crit)
