Thanks so much Mike! I appreciate and am always amazed by your helpfulness and responsiveness.
On Wednesday, January 24, 2018 at 6:36:24 PM UTC-8, Mike Bayer wrote: > > 1.2.2 is released w/ this fix > > On Wed, Jan 24, 2018 at 10:16 AM, Mike Bayer <mik...@zzzcomputing.com > <javascript:>> wrote: > > the plan is to fix and release by EOD, thank you > > > > > https://bitbucket.org/zzzeek/sqlalchemy/issues/4171/list-assignment-does-not-seem-to-be > > > > > > > On Wed, Jan 24, 2018 at 1:13 AM, <vin...@benchling.com <javascript:>> > wrote: > >> Hello! We're currently in the process of upgrading from SQLAlchemy > 1.1.11 to > >> 1.2.1 (we're super excited about selectin!), and noticed some > >> non-deterministic behavior in one of our tests. Here is the minimal > repro > >> that I was able to find: > >> > >> class A(db.Model): > >> __tablename__ = 'a' > >> id = db.Column(db.Integer, primary_key=True) > >> > >> class B(db.Model): > >> __tablename__ = 'b' > >> id = db.Column(db.Integer, primary_key=True) > >> a_id = db.Column(db.Integer, db.ForeignKey('a.id')) > >> a = db.relationship('A', backref=db.backref('bs')) > >> > >> > >> for i in xrange(100): > >> a1 = A() > >> a2 = A() > >> > >> b = B(a=a1) # Set B.a = a1 > >> a2.bs = [b] # ... but then put b onto a2's list > >> > >> db.session.add_all([a1, a2]) > >> db.session.commit() > >> > >> print len(a1.bs) > >> > >> I expect "len(a1.bs)" to always be 0 (and this matches the behavior in > >> SQLAlchemy 1.1). However, in SQLAlchemy 1.2, the length is sometimes 1 > and > >> sometimes 0. Empirically, it looks like it's 1 around 20% of the time. > This > >> is only the case if a1 and a2 are both pending - adding a commit before > >> creating B() makes the non-deterministic behavior go away. > >> > >> Let me know if there's any more information that I can provide here > that > >> would be helpful, happy to help address this in any way I can! > >> > >> -- > >> 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 sqlalchemy+...@googlegroups.com <javascript:>. > >> To post to this group, send email to sqlal...@googlegroups.com > <javascript:>. > >> Visit this group at https://groups.google.com/group/sqlalchemy. > >> For more options, visit https://groups.google.com/d/optout. > -- 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 sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at https://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.