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

Minor typing issue for alembic.context.configure in 1.11.0 #1246

Closed
AlexanderPodorov opened this issue May 16, 2023 · 2 comments
Closed

Minor typing issue for alembic.context.configure in 1.11.0 #1246

AlexanderPodorov opened this issue May 16, 2023 · 2 comments
Labels
bug Something isn't working pep 484 typing related issues

Comments

@AlexanderPodorov
Copy link

Describe the bug
Signature of the alembic.context.configure function has changed in 1.11.0, where compare_server_default argument uses Column classes, which should be generics. This kind of definition produces type checkers warnings.

Expected behavior
No warnings reported by static type checkers

To Reproduce
E.g. using VSCode with Pyright in "strict" mode (usually it is a part of env.py):

from alembic.context import configure
# Throws: Type of "configure" is partially unknown

Versions.

  • OS: MacOS
  • Python: 3.11.3
  • Alembic: 1.11.0
  • SQLAlchemy: 2.0.13
  • Database: Postgres 15
  • DBAPI: asyncpg

Additional context

Have a nice day!

@AlexanderPodorov AlexanderPodorov added the requires triage New issue that requires categorization label May 16, 2023
@zzzeek zzzeek added bug Something isn't working pep 484 typing related issues and removed requires triage New issue that requires categorization labels May 16, 2023
@zzzeek
Copy link
Member

zzzeek commented May 16, 2023

thanks for reporting

@sqla-tester
Copy link
Collaborator

Federico Caselli has proposed a fix for this issue in the main branch:

Define type for generic classes https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/4620

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

No branches or pull requests

3 participants