.tometadata() fails to copy ExcludeConstraints with column-based expressions #5850
Labels
bug
Something isn't working
postgresql
schema
things related to the DDL related objects like Table, Column, CreateIndex, etc.
Milestone
(From https://groups.google.com/g/sqlalchemy/c/4wgEadxCkyk)
We noticed that the copying of ExcludeConstraints as part of a tometadata invocation fails for constraints with column-based expressions. The copy implementation of ExcludeConstraint passes the strname's of its columns to the construction of the new constraint, which is fine for regular columns, but not for more complex expressions.
We've added a small test case (in test_metadata) that reproduces the failure below.
We also implemented a temporary solution that seems to fix the issue by passing copies of the constraint's column expressions instead.
We are on version 1.3.18.
Temporary solution:
Test case
Here's the stacktrace of the test case's failure:
The text was updated successfully, but these errors were encountered: