From 9471fc338f47f6c2fd1f99918428628f30ec955c Mon Sep 17 00:00:00 2001 From: Yusur Princeps Date: Wed, 5 Nov 2025 18:08:49 +0100 Subject: [PATCH] 0.8.1 missing type guard in *bound_fk() --- aliases/sakuragasaki46_suou/pyproject.toml | 2 +- src/suou/__init__.py | 2 +- src/suou/sqlalchemy/orm.py | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/aliases/sakuragasaki46_suou/pyproject.toml b/aliases/sakuragasaki46_suou/pyproject.toml index 6764e6f..39ad228 100644 --- a/aliases/sakuragasaki46_suou/pyproject.toml +++ b/aliases/sakuragasaki46_suou/pyproject.toml @@ -10,7 +10,7 @@ license = "Apache-2.0" readme = "README.md" dependencies = [ - "suou==0.7.7", + "suou==0.8.0", "itsdangerous", "toml", "pydantic", diff --git a/src/suou/__init__.py b/src/suou/__init__.py index a0f3a65..342e5c7 100644 --- a/src/suou/__init__.py +++ b/src/suou/__init__.py @@ -37,7 +37,7 @@ from .redact import redact_url_password from .http import WantsContentType from .color import chalk -__version__ = "0.8.0" +__version__ = "0.8.1" __all__ = ( 'ConfigOptions', 'ConfigParserConfigSource', 'ConfigSource', 'ConfigValue', diff --git a/src/suou/sqlalchemy/orm.py b/src/suou/sqlalchemy/orm.py index 9e0ee91..05271eb 100644 --- a/src/suou/sqlalchemy/orm.py +++ b/src/suou/sqlalchemy/orm.py @@ -255,6 +255,8 @@ def unbound_fk(target: str | Column | InstrumentedAttribute, typ: _T | None = No target_name = target if typ is None: typ = IdType + else: + raise TypeError('target must be a str, a Column or a InstrumentedAttribute') return Column(typ, ForeignKey(target_name, ondelete='SET NULL'), nullable=True, **kwargs) @@ -276,6 +278,8 @@ def bound_fk(target: str | Column | InstrumentedAttribute, typ: _T = None, **kwa target_name = target if typ is None: typ = IdType + else: + raise TypeError('target must be a str, a Column or a InstrumentedAttribute') return Column(typ, ForeignKey(target_name, ondelete='CASCADE'), nullable=False, **kwargs)