Re: [sqlalchemy] alembic del sys.modules[module_id] leading to orm mapper error

2016-02-27 Thread Will Angenent
The code was just to reproduce the exact SQLA error by doing what alembic and SQLA are doing and additionally determining when the garbage collector runs. The theory is that garbage gets collected somewhere in between list(_mapper_registry) in configure_mappers and what happens in _process_depe

Re: [sqlalchemy] alembic del sys.modules[module_id] leading to orm mapper error

2016-02-23 Thread Will Angenent
keys linking these tables. Ensure that referencing columns are associated with a ForeignKey or ForeignKeyConstraint, or specify a 'primaryjoin' expression. Thanks, Will > On 23 Feb 2016, at 02:43, Mike Bayer wrote: > > To be honest I might just say to solve it that way, wit

Re: [sqlalchemy] alembic del sys.modules[module_id] leading to orm mapper error

2016-02-22 Thread Will Angenent
this mapping has something like a *backref* to some model in the > application, that would totally leave a dangling reference. > > Can I have an example of an exact mapping I can stick into an Alembic > migration to see this happening otherwise? > > > > On 02/2

Re: [sqlalchemy] alembic del sys.modules[module_id] leading to orm mapper error

2016-02-21 Thread Will Angenent
I forgot to mention, we’re not using clear_mappers(). Thanks, Will > On 21 Feb 2016, at 19:19, Will Angenent wrote: > > Hi Mike, > > Thanks for your quick response yet again! Here’s the stack trace. > > tests/integration/test_database.py:14: in test_d

Re: [sqlalchemy] alembic del sys.modules[module_id] leading to orm mapper error

2016-02-21 Thread Will Angenent
On 21 Feb 2016, at 19:12, Mike Bayer wrote: > > > > Hi there - > > Can you post a stack trace, and also is your test suite making use of > clear_mappers() ? > > The sys.modules activity is not really the primary cause, it's that alembic > makes use of a mo

[sqlalchemy] alembic del sys.modules[module_id] leading to orm mapper error

2016-02-21 Thread Will Angenent
Hi, We had this interesting issue recently, and I've been trying to figure out if we deserve this, if this is simply unavoidable, or whether it can be considered a bug. We're using python 2.7.6, sqlalchemy 1.0.12 and alembic 0.8.4. Summary: This statement in alembic.util.pyfiles.load_python_f

[sqlalchemy] Re: Unexpected missing join when using joined table inheritance

2015-10-06 Thread Will Angenent
Thanks, that's helpful. We should be able to use both solutions. Thanks for the clarification! -- 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+unsubsc

[sqlalchemy] Unexpected missing join when using joined table inheritance

2015-10-05 Thread Will Angenent
I have run into an interesting condition when using joined table inheritance. For example we have the typical employee, manager and engineer tables with the following relationships: - an engineer is an employee - a manager is an employee - an employee has a manager We find some interesting resu