From d458e36242c60f44b1140697ae04cc8ad8ac5b98 Mon Sep 17 00:00:00 2001 From: hanbin <58972963+hanbin8269@users.noreply.github.com> Date: Wed, 5 Apr 2023 10:46:45 +0900 Subject: [PATCH] Fix type annotation of schema.MetaData.naming_convention According to the documentation, we should be able to use `Callable[Constraint, Table]]` as the value type for MetaData.naming_convention. https://docs.sqlalchemy.org/en/20/core/metadata.html#sqlalchemy.schema.MetaData.params.naming_convention --- lib/sqlalchemy/sql/schema.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sqlalchemy/sql/schema.py b/lib/sqlalchemy/sql/schema.py index b4263137b3..078157820f 100644 --- a/lib/sqlalchemy/sql/schema.py +++ b/lib/sqlalchemy/sql/schema.py @@ -5108,7 +5108,7 @@ class MetaData(HasSchemaAttr): self, schema: Optional[str] = None, quote_schema: Optional[bool] = None, - naming_convention: Optional[Dict[str, str]] = None, + naming_convention: Optional[Dict[str, str | Callable[Constraint, Table]]] = None, info: Optional[_InfoType] = None, ) -> None: """Create a new MetaData object. -- 2.47.3