Closed DanCardin closed 2 years ago
thank you
On Wed, Jun 24, 2020 at 9:10 AM DanCardin notifications@github.com wrote:
In instances where you have more than one model with the same name, sqlalchemy directs you to supply the fully qualified module name. This breaks sqlalchemy-stubs.
if my relationship were defined as:
foo = relationship('package.models.foo.Foo')
it doesn't seem like any combination of TYPE_CHECKING guarded imports, allows it to correctly work.
I assume the issue is here: https://github.com/dropbox/sqlalchemy-stubs/blob/ea93332454f3d5646b87395f82b4d7badbd64de1/sqlmypy.py#L376, where it's just looking for the given arg name in the context.
I would make a PR to just take something like arg.value.split('.')[-1], but I have to imagine mypy has got a better way make actual use of the fact that the fully qualified name is specified (which seems like it would obviate the need for the import if so).
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dropbox/sqlalchemy-stubs/issues/159, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEHEGGG4MGACFMTOJP3LMZTRYIJOBANCNFSM4OGYKJBA .
In instances where you have more than one model with the same name, sqlalchemy directs you to supply the fully qualified module name. This breaks sqlalchemy-stubs.
if my relationship were defined as:
it doesn't seem like any combination of
TYPE_CHECKING
guarded imports, allows it to correctly work.I assume the issue is here: https://github.com/dropbox/sqlalchemy-stubs/blob/ea93332454f3d5646b87395f82b4d7badbd64de1/sqlmypy.py#L376, where it's just looking for the given arg name in the context.
I would make a PR to just take something like
arg.value.split('.')[-1]
, but I have to imagine mypy has got a better way make actual use of the fact that the fully qualified name is specified (which seems like it would obviate the need for the import if so).