0.8.1 missing type guard in *bound_fk()

This commit is contained in:
Yusur 2025-11-05 18:08:49 +01:00
parent 4a31fbc14f
commit 9471fc338f
3 changed files with 6 additions and 2 deletions

View file

@ -10,7 +10,7 @@ license = "Apache-2.0"
readme = "README.md"
dependencies = [
"suou==0.7.7",
"suou==0.8.0",
"itsdangerous",
"toml",
"pydantic",

View file

@ -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',

View file

@ -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)