From 056d7815f0a605b3a1176121922d0b78ce0d23f8 Mon Sep 17 00:00:00 2001 From: Federico Caselli Date: Thu, 2 Feb 2023 20:19:26 +0100 Subject: [PATCH] Use correct dialect annotation Fixes: #9222 Change-Id: Ife841a5cf5ec896405e84d8570ef63ce6176a5ec --- lib/sqlalchemy/dialects/postgresql/types.py | 5 ++++- lib/sqlalchemy/sql/type_api.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/sqlalchemy/dialects/postgresql/types.py b/lib/sqlalchemy/dialects/postgresql/types.py index 6a8224b9a9..a03fcaa392 100644 --- a/lib/sqlalchemy/dialects/postgresql/types.py +++ b/lib/sqlalchemy/dialects/postgresql/types.py @@ -64,12 +64,15 @@ class MONEY(sqltypes.TypeEngine[str]): import re import decimal + from sqlalchemy import Dialect from sqlalchemy import TypeDecorator class NumericMoney(TypeDecorator): impl = MONEY - def process_result_value(self, value: Any, dialect: Any) -> None: + def process_result_value( + self, value: Any, dialect: Dialect + ) -> None: if value is not None: # adjust this for the currency and numeric m = re.match(r"\$([\d.]+)", value) diff --git a/lib/sqlalchemy/sql/type_api.py b/lib/sqlalchemy/sql/type_api.py index fefbf49974..db89bfe8bd 100644 --- a/lib/sqlalchemy/sql/type_api.py +++ b/lib/sqlalchemy/sql/type_api.py @@ -1918,7 +1918,7 @@ class TypeDecorator(SchemaEventTarget, ExternalType, TypeEngine[_T]): raise NotImplementedError() def process_result_value( - self, value: Optional[Any], dialect: Any + self, value: Optional[Any], dialect: Dialect ) -> Optional[_T]: """Receive a result-row column value to be converted. -- 2.47.3