]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
update for mypy 1.14
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 20 Dec 2024 23:02:37 +0000 (18:02 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 20 Dec 2024 23:03:17 +0000 (18:03 -0500)
Change-Id: I7315c06314ed25c2c00f56b2883f97f4489e433c

lib/sqlalchemy/ext/horizontal_shard.py
lib/sqlalchemy/orm/session.py
tox.ini

index 87e767bcd6b72c67813ce9581aa58202492fe85c..b8795853a626e6e9d5c034f3bcf7464debff1d10 100644 (file)
@@ -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,
index 2befa8f43d0e3ba3c6dbf58dacec9a821cab048a..343699cc97e600f1d158b8f5c052948455baa287 100644 (file)
@@ -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 8fdd6e550587717be6e6e2496040ea955db880ea..79d872b58da474249c888c305d3c9aa86015eff5 100644 (file)
--- 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