From: Luís Henrique A. Schünemann <44511825+luishenri@users.noreply.github.com> Date: Thu, 14 Aug 2025 21:16:55 +0000 (-0300) Subject: fix(config): accept int on toml config X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=072f91db6ec993a2b2bb5420420d9d4427f10b62;p=thirdparty%2Fsqlalchemy%2Falembic.git fix(config): accept int on toml config Fixes: #1709 --- diff --git a/alembic/config.py b/alembic/config.py index dcc64a4c..b2720ea2 100644 --- a/alembic/config.py +++ b/alembic/config.py @@ -472,7 +472,7 @@ class Config: self, name: str, default: Optional[Any] = None ) -> Union[None, str, list[str], dict[str, str], list[dict[str, str]]]: USE_DEFAULT = object() - value: Union[None, str, list[str], dict[str, str]] = ( + value: Union[None, str, list[str], dict[str, str], int] = ( self.toml_alembic_config.get(name, USE_DEFAULT) ) if value is USE_DEFAULT: @@ -495,6 +495,8 @@ class Config: "dict[str, str]", {k: v % (self.toml_args) for k, v in value.items()}, ) + elif isinstance(value, int): + value = str(value) else: raise util.CommandError( f"unsupported TOML value type for key: {name!r}"