From: Mike Bayer Date: Wed, 8 Jul 2026 22:57:13 +0000 (-0400) Subject: update for mypy 2.2.0 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4009b58467c0f76d318a336894d754adb9ff4f74;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git update for mypy 2.2.0 Change-Id: I5478706dd47825bba38a87f81cd4e05e3e596a67 --- diff --git a/lib/sqlalchemy/orm/session.py b/lib/sqlalchemy/orm/session.py index 69c9292fd1..f5927c4d88 100644 --- a/lib/sqlalchemy/orm/session.py +++ b/lib/sqlalchemy/orm/session.py @@ -3896,7 +3896,7 @@ class Session(_SessionClassMethods, EventTarget): # takes precedence over execution_options if populate_existing is not None: execution_options = { - **execution_options, # type: ignore[typeddict-item] + **execution_options, "populate_existing": populate_existing, } else: diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py index c5c30c4f8f..c0b1ff38be 100644 --- a/lib/sqlalchemy/sql/elements.py +++ b/lib/sqlalchemy/sql/elements.py @@ -5748,7 +5748,7 @@ class quoted_name(util.MemoizedSlots, str): else: return quoted_name(value, quote) - def __new__(cls, value: str, quote: Optional[bool]) -> quoted_name: + def __new__(cls, value: str, quote: Optional[bool]) -> Self: assert ( value is not None ), "use quoted_name.construct() for None passthrough" @@ -5894,7 +5894,7 @@ class _truncated_label(quoted_name): __slots__ = () - def __new__(cls, value: str, quote: Optional[bool] = None) -> Any: + def __new__(cls, value: str, quote: Optional[bool] = None) -> Self: quote = getattr(value, "quote", quote) # return super(_truncated_label, cls).__new__(cls, value, quote, True) return super().__new__(cls, value, quote)