]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
update case statement in dictlike-polymorphic
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 15 Jul 2021 02:58:07 +0000 (22:58 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 15 Jul 2021 02:59:16 +0000 (22:59 -0400)
this was using a long-ago not working form of case().

Change-Id: I39c7cec2e46dd215d7acb7d3ee6debd30fa1ec34

examples/vertical/dictlike-polymorphic.py

index 23a6e093d9c9bad3fd1750035f0079b490f40479..4c81af6d543db3de53de8bc53f3116cc1ec55179 100644 (file)
@@ -83,7 +83,7 @@ class PolymorphicVerticalProperty(object):
                 for attribute, discriminator in pairs
                 if attribute is not None
             ]
-            return case(whens, self.cls.type, null())
+            return case(whens, value=self.cls.type, else_=null())
 
         def __eq__(self, other):
             return self._case() == cast(other, String)