diff options
author | Gord Thompson <gord@gordthompson.com> | 2021-04-29 12:57:06 -0600 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-04-29 16:24:14 -0400 |
commit | 416fdb1674daf72ef215c6abfed3e08343f1e05e (patch) | |
tree | bec9e502bd7259280a5d42c6822e9d65980fcdd0 /lib/sqlalchemy/sql/schema.py | |
parent | 28493bf4bc35a4802b57b02a8b389cec7b6dcbb6 (diff) | |
download | sqlalchemy-416fdb1674daf72ef215c6abfed3e08343f1e05e.tar.gz |
Fix ForeignKeyConstraint.copy() error
Fixed an issue with the (deprecated in 1.4)
:meth:`_schema.ForeignKeyConstraint.copy` method that caused an error when
invoked with the ``schema`` argument.
Fixes: #6353
Change-Id: I03330d9ec254d64377f2b2e86af69a4eaff43ac6
Diffstat (limited to 'lib/sqlalchemy/sql/schema.py')
-rw-r--r-- | lib/sqlalchemy/sql/schema.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/sqlalchemy/sql/schema.py b/lib/sqlalchemy/sql/schema.py index f2c1c86ec..6ab58c301 100644 --- a/lib/sqlalchemy/sql/schema.py +++ b/lib/sqlalchemy/sql/schema.py @@ -2138,10 +2138,10 @@ class ForeignKey(DialectKWArgs, SchemaItem): "The :meth:`_schema.ForeignKey.copy` method is deprecated " "and will be removed in a future release.", ) - def copy(self, schema=None): - return self._copy(schema) + def copy(self, schema=None, **kw): + return self._copy(schema=schema, **kw) - def _copy(self, schema=None): + def _copy(self, schema=None, **kw): """Produce a copy of this :class:`_schema.ForeignKey` object. The new :class:`_schema.ForeignKey` will not be bound @@ -3309,7 +3309,7 @@ class ColumnCollectionConstraint(ColumnCollectionMixin, Constraint): "is deprecated and will be removed in a future release.", ) def copy(self, target_table=None, **kw): - return self._copy(target_table, **kw) + return self._copy(target_table=target_table, **kw) def _copy(self, target_table=None, **kw): # ticket #5276 @@ -3439,7 +3439,7 @@ class CheckConstraint(ColumnCollectionConstraint): "and will be removed in a future release.", ) def copy(self, target_table=None, **kw): - return self._copy(target_table, **kw) + return self._copy(target_table=target_table, **kw) def _copy(self, target_table=None, **kw): if target_table is not None: @@ -3732,7 +3732,7 @@ class ForeignKeyConstraint(ColumnCollectionConstraint): "and will be removed in a future release.", ) def copy(self, schema=None, target_table=None, **kw): - return self._copy(target_table, **kw) + return self._copy(schema=schema, target_table=target_table, **kw) def _copy(self, schema=None, target_table=None, **kw): fkc = ForeignKeyConstraint( |