Closed YaraslauZhylko closed 1 year ago
Thanks for the report! I'm not sure how much utility that bound is providing anyways. I have a solution, but it no longer actually references sqlalchemy types.
Before I release it, I wonder if you might install this branch https://github.com/DanCardin/sqlalchemy-declarative-extensions/pull/38 and see if it fixes your issue?
I dont have any real sqlalchemy2 projects handy, and I'm not entirely convinced this wont have side effects.
I've reverted to runtime checks here, because it seems to be impossible/impractical to have actually typed input types that support both versions.
As a result, I suspect it's much more likely to "just work" so I just merged/released it in v0.6.4.
Lmk if this does/doesnt solve your problem!
I'm sorry I missed the GitHub notification.
I tried the 0.6.4
release and it seems to have fixed the issue. At least I do not need # type: ignore
any more. 😅
No regressions encountered so far.
Thank you.
sqlalchemy-declarative-extensions
documentation suggests to declare the ORM base class like this:But as of now,
declarative_base
is being deprecated:So I try to use
DeclarativeBase
as a base class like this:And as a result, I get a
mypy
error:I guess the following line needs some adjustment to get work with both the old and the new declaration style: https://github.com/DanCardin/sqlalchemy-declarative-extensions/blob/bd52ff8bd90220c97a3a20b62dba4d37857b1dfb/src/sqlalchemy_declarative_extensions/api.py#L24