-
-
Notifications
You must be signed in to change notification settings - Fork 246
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
process_revision_directives
documentation disagrees with type annotation
#1325
Comments
hi - for simple documentation issues we can accept PRs to correct problems. thanks! |
@zzzeek So is the mistake simply that the third argument should be documented as a list of |
OK. the attribute is in practice a MigrationScript, I will attempt to change the typing to show MigrationScript all the way through and rewrite the doc example to be typed. |
Mike Bayer has proposed a fix for this issue in the main branch: match process_revision_directives typing to API https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/4927 |
for the next release 1.12.1 |
Fixed regression caused by 🎫`879` released in 1.7.0 where the ".info" dictionary of ``Table`` would not render in autogenerate create table statements. This can be useful for custom create table DDL rendering schemes so it is restored. Additionally upon seeing that Rewriter is failing typing that was just imporved in the previous commit for #1325 / Ibfb7a57a081818c290cf0964d12a72b85c2c1983, further correct the typing of the "revision" argument for process_revision_directives which was still inconsistent. Change-Id: Ifa4c7bd1b730d51629f42bc159b994f42d157c04 Fixes: #1329
The documentation for
EnvironmentContext.configure.process_revision_directives
states that the callable's third argument is a list ofMigrationScript
s, yet the type annotations in the code state that the third argument is a list ofMigrateOperation
s, a superclass ofMigrationScript
.This causes problems in particular when trying to add type annotations to the code from the "Don't Generate Empty Migrations with Autogenerate" recipe, as use of the
upgrade_ops
property assumes that the list elements areMigrationScript
s.To Reproduce
Running mypy 1.6.0 (default config) on the following code:
fails with the error:
If
MigrationScript
is changed toMigrateOperation
, the error changes to:Versions.
The text was updated successfully, but these errors were encountered: