From: Mike Bayer Date: Fri, 20 Dec 2024 23:02:37 +0000 (-0500) Subject: update for mypy 1.14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b39afd5008bef95a8c2c30eada1e22ef6a286670;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git update for mypy 1.14 Change-Id: I7315c06314ed25c2c00f56b2883f97f4489e433c --- diff --git a/lib/sqlalchemy/ext/horizontal_shard.py b/lib/sqlalchemy/ext/horizontal_shard.py index 87e767bcd6..b8795853a6 100644 --- a/lib/sqlalchemy/ext/horizontal_shard.py +++ b/lib/sqlalchemy/ext/horizontal_shard.py @@ -321,7 +321,7 @@ class ShardedSession(Session): state.identity_token = shard_id return shard_id - def connection_callable( # type: ignore [override] + def connection_callable( self, mapper: Optional[Mapper[_T]] = None, instance: Optional[Any] = None, diff --git a/lib/sqlalchemy/orm/session.py b/lib/sqlalchemy/orm/session.py index 2befa8f43d..343699cc97 100644 --- a/lib/sqlalchemy/orm/session.py +++ b/lib/sqlalchemy/orm/session.py @@ -1775,7 +1775,7 @@ class Session(_SessionClassMethods, EventTarget): # the idea is that at some point NO_ARG will warn that in the future # the default will switch to close_resets_only=False. - if close_resets_only or close_resets_only is _NoArg.NO_ARG: + if close_resets_only in (True, _NoArg.NO_ARG): self._close_state = _SessionCloseState.CLOSE_IS_RESET else: self._close_state = _SessionCloseState.ACTIVE diff --git a/tox.ini b/tox.ini index 8fdd6e5505..79d872b58d 100644 --- a/tox.ini +++ b/tox.ini @@ -188,7 +188,7 @@ commands= [testenv:pep484] deps= greenlet != 0.4.17 - mypy >= 1.7.0 + mypy >= 1.14.0 types-greenlet commands = mypy {env:MYPY_COLOR} ./lib/sqlalchemy