Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revision function's type annotation is partial. #1110

Closed
mmohaveri opened this issue Nov 7, 2022 · 3 comments
Closed

revision function's type annotation is partial. #1110

mmohaveri opened this issue Nov 7, 2022 · 3 comments
Labels
pep 484 typing related issues

Comments

@mmohaveri
Copy link

Describe the bug

Revision function's type annotation causes "Type is partially unknown" error. The root of the issue is that process_revision_directives's argument has been typed with Callable which is a partial type (as it lacks definition of the signature of the function).

Expected behavior
I expect the type of the process_revision_directives to be fully defined so type checkers like Pyright won't give me an error.

To Reproduce
Just write any code that imports revision and run pyright on it.

@mmohaveri mmohaveri added the requires triage New issue that requires categorization label Nov 7, 2022
@zzzeek zzzeek added cant reproduce and removed requires triage New issue that requires categorization labels Nov 7, 2022
@zzzeek
Copy link
Member

zzzeek commented Nov 7, 2022

hey there -

here's a script, I can't get it to reproduce a problem, does this cause a problem on your end?

from alembic.script import revision

map_ = revision.RevisionMap(
    lambda: [
        revision.Revision("a", ()),
        revision.Revision("b", ("a",)),
        revision.Revision("c", ("b",)),
    ]
)

@zzzeek zzzeek added the pep 484 typing related issues label Nov 7, 2022
@zzzeek
Copy link
Member

zzzeek commented Nov 7, 2022

oh. you mean "from alembic.command import revision".

@sqla-tester
Copy link
Collaborator

Mike Bayer has proposed a fix for this issue in the main branch:

add typing parameters https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/4179

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pep 484 typing related issues
Projects
None yet
Development

No branches or pull requests

3 participants