On 6/14/15 9:06 AM, Ofir Herzas wrote:
It seems that MetaData.sorted_tables returns a different result each time.
While the results seem to be always correct, it is an odd behavior.
A topological sort is non-deterministic. If two elements A and B have no dependency on each other, they can be returned in either order.

However, the sorted_tables accessor was specifically enhanced to use a deterministic sorting in 1.0, where the list of items passed to the topological algorithm is first sorted alphabetically, and an ordered set is used internally, so that it comes up with the same result each time.

So, did you try 1.0 ?





I would expect sorted_tables to return the same results every time

|
importsqlalchemy assa
engine =sa.create_engine("<db_url>",echo=False)

meta =sa.MetaData(bind=engine,reflect=True)
a =[t.name fort inmeta.sorted_tables]

meta =sa.MetaData(bind=engine,reflect=True)
b =[t.name fort inmeta.sorted_tables]
|

*a and b are not sorted the same*
*
*
*BTW: meta.tables is consistent ...*
--
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] <mailto:[email protected]>. To post to this group, send email to [email protected] <mailto:[email protected]>.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

--
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 http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to