]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
fix(config): accept int on toml config
authorLuís Henrique A. Schünemann <44511825+luishenri@users.noreply.github.com>
Thu, 14 Aug 2025 21:16:55 +0000 (18:16 -0300)
committerLuís Henrique Allebrandt Schunemann <44511825+luishenri@users.noreply.github.com>
Thu, 14 Aug 2025 21:45:11 +0000 (18:45 -0300)
Fixes: #1709
alembic/config.py

index dcc64a4cfd9f0543d55a13b985ca16e1b1b132ba..b2720ea26d56da8444d574907dbcd65f938f1efe 100644 (file)
@@ -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}"