diff options
author | mike bayer <mike_mp@zzzcomputing.com> | 2022-01-06 19:15:06 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@ci3.zzzcomputing.com> | 2022-01-06 19:15:06 +0000 |
commit | dd5f9c2039731adb6c019c4cc3a39694f9b236ad (patch) | |
tree | ce80dd61476c0c09f792f5690c7c7434b7876cc7 /lib/sqlalchemy/sql/elements.py | |
parent | f3c93170dcbe705da25bc18bad2b29620d82a490 (diff) | |
parent | 01c50c64e302c193733cef7fb146fbab8eaa44bd (diff) | |
download | sqlalchemy-dd5f9c2039731adb6c019c4cc3a39694f9b236ad.tar.gz |
Merge "Remove all remaining removed_in_20 warnings slated for removal" into main
Diffstat (limited to 'lib/sqlalchemy/sql/elements.py')
-rw-r--r-- | lib/sqlalchemy/sql/elements.py | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py index 6e5fbba88..3ec702e10 100644 --- a/lib/sqlalchemy/sql/elements.py +++ b/lib/sqlalchemy/sql/elements.py @@ -2785,10 +2785,7 @@ class Case(ColumnElement): ("else_", InternalTraversal.dp_clauseelement), ] - # TODO: for Py2k removal, this will be: - # def __init__(self, *whens, value=None, else_=None): - - def __init__(self, *whens, **kw): + def __init__(self, *whens, value=None, else_=None): r"""Produce a ``CASE`` expression. The ``CASE`` construct in SQL is a conditional object that @@ -2875,8 +2872,7 @@ class Case(ColumnElement): whether or not :paramref:`.case.value` is used. .. versionchanged:: 1.4 the :func:`_sql.case` - function now accepts the series of WHEN conditions positionally; - passing the expressions within a list is deprecated. + function now accepts the series of WHEN conditions positionally In the first form, it accepts a list of 2-tuples; each 2-tuple consists of ``(<sql expression>, <value>)``, where the SQL @@ -2911,24 +2907,14 @@ class Case(ColumnElement): """ - if "whens" in kw: - util.warn_deprecated_20( - 'The "whens" argument to case() is now passed using ' - "positional style only, not as a keyword argument." - ) - whens = (kw.pop("whens"),) - whens = coercions._expression_collection_was_a_list( "whens", "case", whens ) - try: whens = util.dictlike_iteritems(whens) except TypeError: pass - value = kw.pop("value", None) - whenlist = [ ( coercions.expect( @@ -2954,15 +2940,11 @@ class Case(ColumnElement): self.type = type_ self.whens = whenlist - else_ = kw.pop("else_", None) if else_ is not None: self.else_ = coercions.expect(roles.ExpressionElementRole, else_) else: self.else_ = None - if kw: - raise TypeError("unknown arguments: %s" % (", ".join(sorted(kw)))) - @property def _from_objects(self): return list( |