Skip to content

Commit

Permalink
Fix type annotations in create_foreign_key (#1430)
Browse files Browse the repository at this point in the history
The constraint name parameter of create_foreign_key should be optional, but the batch function
defined it as str instead of Optional[str].

Closes #1429
  • Loading branch information
kasium committed Feb 22, 2024
1 parent a22d21a commit 88769c5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion alembic/operations/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1721,7 +1721,7 @@ def create_exclude_constraint(

def create_foreign_key(
self,
constraint_name: str,
constraint_name: Optional[str],
referent_table: str,
local_cols: List[str],
remote_cols: List[str],
Expand Down
2 changes: 1 addition & 1 deletion alembic/operations/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ def create_foreign_key(
def batch_create_foreign_key(
cls,
operations: BatchOperations,
constraint_name: str,
constraint_name: Optional[str],
referent_table: str,
local_cols: List[str],
remote_cols: List[str],
Expand Down

0 comments on commit 88769c5

Please sign in to comment.