]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Don't pass vistor to immutables in cloned traverse
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 12 Apr 2022 13:41:55 +0000 (09:41 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 12 Apr 2022 14:09:56 +0000 (10:09 -0400)
commit0bfb620009f668e97ad3c2c25a564ca36428b9ae
treef6b3b5328f35c512315b961e5925b6e8fb33d01d
parenta45e2284dad17fbbba3bea9d5e5304aab21c8c94
Don't pass vistor to immutables in cloned traverse

Saw someone using cloned_traverse to move columns around
(changing their .table) and not surprisingly having poor results.
As cloned traversal is to provide a hook for in-place mutation
of elements, it should not be given Immutable objects as these
should not be changed once they are structurally composed.

Change-Id: I43b22f52f243ef481a75d2cf5ecc73d50f110a81
lib/sqlalchemy/sql/base.py
lib/sqlalchemy/sql/visitors.py
test/sql/test_external_traversal.py