Alembic doesn't throw TypeError on unexpected keyword arguments

Issue #156 resolved
created an issue

Alembic shouldn't just ignore keyword arguments that are not used. I recently typod "postgesql_where" and to my surprise, Alembic just went along with it and created an invalid index.

Case example:

        postresql_where=text("reseller_id IS NULL"),

What I expected:

TypeError: op.create_index() got an unexpected keyword argument 'postresql_where'

Comments (4)

  1. Michael Bayer repo owner

    this isn't really possible, because technically SQLAlchemy can't know that there isn't a 3rd party dialect called "postresql" in use. Other kwargs that don't take the form "<dialectname>_<argument>" are rejectable on the SQLAlchemy side, right now this logic takes effect for tables and constraints but is missing on the index side. but wouldn't help this case.

  2. Log in to comment