-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
synonym_for without docstring break Sphinx autodoc builds (infinite recursion) #4767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Here is a full example configured with tox (against python 2.7 and 3.5): Output for me:
|
no workaround other than call configure_mappers() or apply a name, fix will be in next release |
Mike Bayer has proposed a fix for this issue in the master branch: Intercept uncompiled comparator attrbute error for attr access https://gerrit.sqlalchemy.org/1358 |
Actually I found another one: Add the missing docstring :-) Thanks for the hint about configure_mappers(), wondered about that functionality as well. Greetings, Torsten |
OK now that I've gotten to look at this,the special thing you are doing is making a synonym to an attribute that does not exist yet, until the configure_mappers() sets up the backref. that's why this case is special. if you use two relationships with back_populates instead you should not get this problem. |
Mike Bayer has proposed a fix for this issue in the rel_1_3 branch: Intercept unresolveable comparator attrbute error for attr access https://gerrit.sqlalchemy.org/1359 |
Fixed bug where a synonym created against a mapped attribute that does not exist yet, as is the case when it refers to backref before mappers are configured, would raise recursion errors when trying to test for attributes on it which ultimately don't exist (as occurs when the classes are run through Sphinx autodoc), as the unconfigured state of the synonym would put it into an attribute not found loop. Fixes: #4767 Change-Id: I9aade8628349fbf538181a0049416cec0a17179c (cherry picked from commit 234723f)
Hi *,
the following code illustrates the fundamental problem: Accessing the
__name__
property of a synonym causes recursion:With this, the following attribute access recurses:
For this reason our sphinx documentation does not build anymore (as properties from mixin classes did not supply a docstring). Took a while to find the cause...
No idea what's going on inside SQLAlchemy here though.
The text was updated successfully, but these errors were encountered: