From: hanbin <58972963+hanbin8269@users.noreply.github.com> Date: Wed, 5 Apr 2023 01:46:45 +0000 (+0900) Subject: Fix type annotation of schema.MetaData.naming_convention X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d458e36242c60f44b1140697ae04cc8ad8ac5b98;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git 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 --- 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.