somewhere you should be calling something like:

Load(User).lazyload("*")

if you can skip doing it that way (e.g. with Load()), or at least
confirm that removing that part makes your error go away, that would
help to confirm exactly that this is the problem.  Otherwise stay on
1.2.8 until 1.2.10 comes out.  Issue is
https://bitbucket.org/zzzeek/sqlalchemy/issues/4298/regression-in-strategy-pathing.



On Sun, Jul 8, 2018 at 6:33 PM, Mike Bayer <[email protected]> wrote:
> Thank you, I can figure that out
>
> On Sun, Jul 8, 2018, 3:31 PM Chad Birch <[email protected]> wrote:
>>
>> Sorry, here's the stack trace:
>>
>> Traceback (most recent call last):
>>   File
>> "/opt/venvs/tildes/lib/python3.6/site-packages/pyramid_debugtoolbar/panels/performance.py",
>> line 58, in resource_timer_handler
>>     result = handler(request)
>>   File
>> "/opt/venvs/tildes/lib/python3.6/site-packages/pyramid_tm/__init__.py", line
>> 171, in tm_tween
>>     reraise(*exc_info)
>>   File
>> "/opt/venvs/tildes/lib/python3.6/site-packages/pyramid_tm/compat.py", line
>> 36, in reraise
>>     raise value
>>   File
>> "/opt/venvs/tildes/lib/python3.6/site-packages/pyramid_tm/__init__.py", line
>> 136, in tm_tween
>>     response = handler(request)
>>   File "/opt/venvs/tildes/lib/python3.6/site-packages/pyramid/tweens.py",
>> line 41, in excview_tween
>>     response = _error_handler(request, exc)
>>   File "/opt/venvs/tildes/lib/python3.6/site-packages/pyramid/tweens.py",
>> line 12, in _error_handler
>>     response = request.invoke_exception_view(exc_info)
>>   File "/opt/venvs/tildes/lib/python3.6/site-packages/pyramid/view.py",
>> line 744, in invoke_exception_view
>>     request_iface=request_iface.combined,
>>   File "/opt/venvs/tildes/lib/python3.6/site-packages/pyramid/view.py",
>> line 642, in _call_view
>>     response = view_callable(context, request)
>>   File
>> "/opt/venvs/tildes/lib/python3.6/site-packages/pyramid/viewderivers.py",
>> line 410, in viewresult_to_response
>>     result = view(context, request)
>>   File "/opt/venvs/tildes/lib/python3.6/site-packages/pyramid/tweens.py",
>> line 39, in excview_tween
>>     response = handler(request)
>>   File "/opt/venvs/tildes/lib/python3.6/site-packages/pyramid/router.py",
>> line 156, in handle_request
>>     view_name
>>   File "/opt/venvs/tildes/lib/python3.6/site-packages/pyramid/view.py",
>> line 642, in _call_view
>>     response = view_callable(context, request)
>>   File
>> "/opt/venvs/tildes/lib/python3.6/site-packages/pyramid/viewderivers.py",
>> line 390, in attr_view
>>     return view(context, request)
>>   File
>> "/opt/venvs/tildes/lib/python3.6/site-packages/pyramid/viewderivers.py",
>> line 368, in predicate_wrapper
>>     return view(context, request)
>>   File
>> "/opt/venvs/tildes/lib/python3.6/site-packages/pyramid/viewderivers.py",
>> line 301, in secured_view
>>     return view(context, request)
>>   File
>> "/opt/venvs/tildes/lib/python3.6/site-packages/pyramid/viewderivers.py",
>> line 513, in csrf_view
>>     return view(context, request)
>>   File
>> "/opt/venvs/tildes/lib/python3.6/site-packages/pyramid/viewderivers.py",
>> line 439, in rendered_view
>>     result = view(context, request)
>>   File
>> "/opt/venvs/tildes/lib/python3.6/site-packages/pyramid/viewderivers.py",
>> line 148, in _requestonly_view
>>     response = view(request)
>>   File
>> "/opt/venvs/tildes/lib/python3.6/site-packages/webargs/pyramidparser.py",
>> line 121, in wrapper
>>     return func(obj, *args, **kwargs)
>>   File "/opt/tildes/tildes/views/api/web/comment.py", line 100, in
>> post_comment_reply
>>     print(new_comment.topic.group.path)
>>   File
>> "/opt/venvs/tildes/lib/python3.6/site-packages/sqlalchemy/orm/attributes.py",
>> line 242, in __get__
>>     return self.impl.get(instance_state(instance), dict_)
>>   File
>> "/opt/venvs/tildes/lib/python3.6/site-packages/sqlalchemy/orm/attributes.py",
>> line 599, in get
>>     value = self.callable_(state, passive)
>>   File
>> "/opt/venvs/tildes/lib/python3.6/site-packages/sqlalchemy/orm/strategies.py",
>> line 631, in _load_for_state
>>     session, state, primary_key_identity, passive)
>>   File "<string>", line 1, in <lambda>
>>
>>   File
>> "/opt/venvs/tildes/lib/python3.6/site-packages/sqlalchemy/orm/strategies.py",
>> line 713, in _emit_lazyload
>>     state.load_options, effective_path
>>   File
>> "/opt/venvs/tildes/lib/python3.6/site-packages/sqlalchemy/ext/baked.py",
>> line 185, in _add_lazyload_options
>>     cache_key = opt._generate_cache_key(cache_path)
>>   File
>> "/opt/venvs/tildes/lib/python3.6/site-packages/sqlalchemy/orm/strategy_options.py",
>> line 91, in _generate_cache_key
>>     chopped = self._chop_path(loader_path, path)
>>   File
>> "/opt/venvs/tildes/lib/python3.6/site-packages/sqlalchemy/orm/strategy_options.py",
>> line 388, in _chop_path
>>     elif c_token.is_mapper and p_token.is_mapper and \
>> AttributeError: 'str' object has no attribute 'is_mapper'
>>
>>
>>
>> On Sun, Jul 8, 2018 at 7:13 AM, Mike Bayer <[email protected]>
>> wrote:
>>>
>>> Hi there -
>>>
>>> Please share at least what "the error" you've referred towards actually
>>> says.    Include the complete stack trace please.
>>>
>>>
>>>
>>> On Sat, Jul 7, 2018, 8:53 PM <[email protected]> wrote:
>>>>
>>>> Sorry, I haven't been able to reproduce this in a way that I can provide
>>>> a test case, but SQLAlchemy 1.2.9 is causing a crash in my web application
>>>> (which uses Pyramid, pyramid-tm, and zope.sqlalchemy). I have confirmed 
>>>> that
>>>> it works with 1.2.8 - leaving everything else exactly the same and only
>>>> upgrading SQLAlchemy to 1.2.9 causes it to start crashing.
>>>>
>>>> Basically, I have a Comment object which has a relationship to a parent
>>>> Topic, and the topic has a relationship to a parent Group. The 
>>>> relationships
>>>> are very basic ones:
>>>>
>>>> comment.topic = relationship('Topic', innerjoin=True)
>>>> topic.group = relationship('Group', innerjoin=True)
>>>>
>>>> The crash occurs when accessing a property on a Comment, which itself
>>>> uses a property from its parent Topic, and that property uses a column from
>>>> its parent Group. So it seems like it may be related to the two-layer deep
>>>> relationship, with them both being lazy. Setting lazy=False on the
>>>> topic-group relationship (the "deeper" one) fixes the error, but does not
>>>> help if set on the comment-topic one.
>>>>
>>>> Please let me know if I can provide any more info to help narrow the
>>>> cause down.
>>>>
>>>>  - Chad
>>>>
>>>> --
>>>> 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 [email protected].
>>>> To post to this group, send email to [email protected].
>>>> 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 [email protected].
>>> To post to this group, send email to [email protected].
>>> 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 [email protected].
>> To post to this group, send email to [email protected].
>> 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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to