

def _case(self):
    pairs = set(self.cls.type_map.values())
    whens = [(literal_column(("'%s'" % discriminator)), cast(getattr(self.cls, attribute), String)) for (attribute, discriminator) in pairs if (attribute is not None)]
    return case(whens, self.cls.type, null())

dataset/ETHPy150Open zzzeek/sqlalchemy/examples/vertical/dictlike-polymorphic.py PolymorphicVerticalProperty.value._case/original