From 4a121f07d4224eb995c73926ca0921995edb05a0 Mon Sep 17 00:00:00 2001 From: Markus Hauru Date: Sat, 16 Sep 2023 10:31:43 +0200 Subject: [PATCH] Fix the type annotation of MetaData.reflect's argument `only` (#10352) --- lib/sqlalchemy/sql/schema.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/sqlalchemy/sql/schema.py b/lib/sqlalchemy/sql/schema.py index de6507145d..56d652dbb1 100644 --- a/lib/sqlalchemy/sql/schema.py +++ b/lib/sqlalchemy/sql/schema.py @@ -5611,7 +5611,9 @@ class MetaData(HasSchemaAttr): bind: Union[Engine, Connection], schema: Optional[str] = None, views: bool = False, - only: Optional[_typing_Sequence[str]] = None, + only: Union[ + _typing_Sequence[str], Callable[[str, MetaData], bool], None + ] = None, extend_existing: bool = False, autoload_replace: bool = True, resolve_fks: bool = True, -- 2.47.3