You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Non-blocking items deferred by the final whole-branch review of #76, plus pre-existing nits it surfaced. None affect released behavior.
Hardening candidates
Residual util.get_model_class edge paths.First-class SQLModel & FastAPI support (v2.6.0) #76 fixed the kwargs-on-bare-Exception bug (TypeError instead of the intended errors), but two adjacent paths still leak raw exceptions: a valid module with a missing class name ("tests.models.NoSuchClass") raises raw AttributeError because the getattr sits outside the try, and a dotless path ("nodots") raises ValueError from the rsplit unpack. Fix: move the getattr into the try and catch ValueError on the split, so both raise InvalidModelPath/UnsupportedClassError with messages. Natural fit with the validator/seeder hardening line of work.
autoflush=False regression test for the FK-column filter flush.HybridSeeder._setup_filter_instance's column branch has an autoflush-gated flush() (a select() of a raw Core column skips the ORM autoflush legacy Query performed). Parity for autoflush=False sessions was verified manually during review but no test pins it — a ~10-line test would prevent someone later "simplifying" the gate away.
Cosmetic
Hoist the mid-file import unittest in tests/test_sqlmodel.py (~line 156) to the top imports (after the importorskip).
README "Works with SQLModel & FastAPI" example: add an # app/__init__.py (empty) breadcrumb — the example runs as-is via PEP 420 namespace packages, but real projects have the file.
Remove the stray module-level print(repr(val)) at the bottom of tests/models.py (fires on every test-suite import).
Non-blocking items deferred by the final whole-branch review of #76, plus pre-existing nits it surfaced. None affect released behavior.
Hardening candidates
util.get_model_classedge paths. First-class SQLModel & FastAPI support (v2.6.0) #76 fixed the kwargs-on-bare-Exceptionbug (TypeErrorinstead of the intended errors), but two adjacent paths still leak raw exceptions: a valid module with a missing class name ("tests.models.NoSuchClass") raises rawAttributeErrorbecause thegetattrsits outside thetry, and a dotless path ("nodots") raisesValueErrorfrom thersplitunpack. Fix: move thegetattrinto thetryand catchValueErroron the split, so both raiseInvalidModelPath/UnsupportedClassErrorwith messages. Natural fit with the validator/seeder hardening line of work.autoflush=Falseregression test for the FK-column filter flush.HybridSeeder._setup_filter_instance's column branch has an autoflush-gatedflush()(aselect()of a raw Core column skips the ORM autoflush legacyQueryperformed). Parity forautoflush=Falsesessions was verified manually during review but no test pins it — a ~10-line test would prevent someone later "simplifying" the gate away.Cosmetic
import unittestintests/test_sqlmodel.py(~line 156) to the top imports (after theimportorskip).# app/__init__.py (empty)breadcrumb — the example runs as-is via PEP 420 namespace packages, but real projects have the file.print(repr(val))at the bottom oftests/models.py(fires on every test-suite import).Context: PR #76 · v2.6.0