-
-
Notifications
You must be signed in to change notification settings - Fork 254
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
TypeError: drop_index() takes 2 positional arguments but 3 were given #1243
Comments
+1. Same here. The upgrade is breaking. Same error too. |
ah i was almost going to change that one too. |
Can I just confirm that the migration given is fairly old, |
hm, OK so, the correct form of this migration: def upgrade() -> None:
# This worked on 1.10.4, but broke on 1.11.0
op.drop_index("dummy_index_name", "dummy_table_name")
pass should be this: def upgrade() -> None:
op.drop_index("dummy_index_name", table_name="dummy_table_name")
pass It looks like the previous syntax was changed in this commit: 20c0806. that was in 2014. kind of a tossup if we just please ask users to upgrade very old migrations or not, but I'll restore it now anyway. |
Mike Bayer has proposed a fix for this issue in the main branch: restore drop_index.table_name as positional https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/4618 |
The alembic update contained breaking changes. We should manually update the library in the future. sqlalchemy/alembic#1243
Yeah, this is from an old migration. Thank you so much for looking into this. |
Alembic 1.11.0 made the `table_name` argument of `op.drop_index()` keyword-only, causing the following failure in the test_galaxy_packages build (where alembic is not pinned): ``` galaxy/model/migrations/util.py:30: error: Too many positional arguments for "drop_index" [misc] op.drop_index(index_name, table_name) ^ ``` xref: sqlalchemy/alembic#1243 Also drop the unused `columns` parameter from our wrapper method, as done already in the dev branch.
The alembic update contained breaking changes. We should manually update the library in the future. sqlalchemy/alembic#1243
Describe the bug
Upgrading from 1.10.4 to 1.11.0 breaks existing migration, possibly due to this change: #1130
Expected behavior
Existing migration still works, or a deprecation warning with clear migration path is given.
To Reproduce
Please try to provide a Minimal, Complete, and Verifiable example, with the migration script and/or the SQLAlchemy tables or models involved.
See also Reporting Bugs on the website.
Error
Versions.
alembic==1.11.0
SQLAlchemy==2.0.13
PyMySQL==1.0.3
Additional context
Have a nice day!
The text was updated successfully, but these errors were encountered: