Skip to content

Commit

Permalink
fix(289): Avoid modifying params when in assoc handling
Browse files Browse the repository at this point in the history
When handling assoc tables, we use the existing properties and use them
for another query for the version tables.
But if we modify the existing dict - in some dialects, that causes the
original query to be modified (For example oracle with cx-oracle library)

Avoid mutating the properties to avoid such issues.
  • Loading branch information
AbdealiLoKo authored and marksteward committed Aug 28, 2022
1 parent 2e0768a commit 38cef84
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sqlalchemy_continuum/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,11 +402,10 @@ def append_association_operation(self, conn, table_name, params, op):
"""
Append history association operation to pending_statements list.
"""
params['operation_type'] = op
stmt = (
self.metadata.tables[self.options['table_name'] % table_name]
.insert()
.values(params)
.values({**params, 'operation_type': op})
)
try:
uow = self.units_of_work[conn]
Expand Down

0 comments on commit 38cef84

Please sign in to comment.