[Sqlalchemy-tickets] Issue #3632: Automap fails when using pickled metadata and overriding reflecte
Brought to you by:
zzzeek
|
From: n1ywb <iss...@bi...> - 2016-01-21 02:00:16
|
New issue 3632: Automap fails when using pickled metadata and overriding reflected metadata with tables https://bitbucket.org/zzzeek/sqlalchemy/issues/3632/automap-fails-when-using-pickled-metadata n1ywb: Testcase: httpshttps://gist.github.com/anonymous/e343baf76747d104a15e If you comment out the pickling line, it works. Otherwise, it fails with ``` #!python sqlalchemy.exc.ArgumentError: Could not locate any simple equality expressions involving locally mapped foreign key columns for primary join condition 'server.id = site.server' on relationship Site.server_. Ensure that referencing columns are associated with a ForeignKey or ForeignKeyConstraint, or are annotated in the join condition with the foreign() annotation. To allow comparison operators other than '==', the relationship can be marked as viewonly=True. ``` The only difference it makes is whether or not the metadata has been pickled. You can also make it work by commenting out the class declarations but I thought automap was supposed to permit you to gracefully override reflected metadata, even if it's been pickled. Python 2.7.11 SQLAlchemy==1.0.10 PyMySQL==0.6.7 Thanks, Jeff |