I'm trying to use ClauseAdapter.traverse similar to how it's used in your old blog post to substitute columns in arbitrary clauses with columns on a different selectable that share an ancestor: http://techspot.zzzeek.org/archive/2008/01/1/
Even in a simple case using a BinaryExpression, ClauseAdapter(selectable).traverse(binaryexpression) is simply returning the expression. When I looked at it with the debugger, it seems the expression isn't being traversed, but rather it eventually feeds the entire BinaryExpression object into corresponding_column and subsequently returns the full expression since obviously the BinaryExpression can't be matched to a particular column on the selectable. selectable.corresponding_column(binaryexpression.left) returns the correct column, however ClauseAdapter(selectable).traverse(binaryexpression.left) does not. The discrepancy is found in corresponding_column being called with require_embedded=True during traverse, which is hardcoded. I don't know if this behavior causes the behavior I previously described with the BinaryExpression being passed to corresponding_column, but it seemed noteworthy. Any ideas for fixes or alternatives? Thanks -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.
