sqlalchemy / alembic

A database migrations tool for SQLAlchemy.
MIT License
2.76k stars 241 forks source link

create_foreign_key has wrong type annotations #1429

Closed kasium closed 7 months ago

kasium commented 7 months ago

Describe the bug BatchOperations.create_foreign_key states that the constraint_name should be a string, but it should be Optional[str]

Versions.

Additional context I'm happy to open a PR, but first wanted to create an issue

Have a nice day!

CaselIT commented 7 months ago

Hi,

Indeed it seems to be a bug, since the normal create_fk has it optional: https://github.com/sqlalchemy/alembic/blob/a22d21a43c2eb7a12944377168727ed76a51aaa9/alembic/operations/ops.py#L595-L696

A PR would be appreciated!

kasium commented 7 months ago

@CaselIT thanks for the confirmation. I'll open a PR

kasium commented 7 months ago

Do you already have a plan when you want to release a new alembic version?

CaselIT commented 7 months ago

Not yet, but it shouldn't be too long