limit query apply_strategies

23 views
Skip to first unread message

Zhou Li

unread,
Feb 16, 2022, 3:24:12 AM2/16/22
to Gremlin-users
When i use python, the error occured. My query is:
g.V(14012536).as_('start').repeat(__.timeLimit(2000).both()).until(__.loops().is_(1)).dedup().as_('a').limit(__.select('a').hasId(288854240, 295903304, 290861088).count().map(lambda: ("it.get()", "gremlin-groovy")).toList()).toList()

Error detail: 

  File "xxx\lib\site-packages\gremlin_python\process\traversal.py", line 57, in toList
    return list(iter(self))
  File "xxx\lib\site-packages\gremlin_python\process\traversal.py", line 47, in __next__
    self.traversal_strategies.apply_strategies(self)
AttributeError: 'NoneType' object has no attribute 'apply_strategies'

Can anyone tell me how to fix the error.

Stephen Mallette

unread,
Feb 16, 2022, 6:36:54 AM2/16/22
to gremli...@googlegroups.com
I'm not sure but you have a embedded toList() on an anonymous traversal:

map(lambda: ("it.get()", "gremlin-groovy")).toList()

that toList() is causing the anonymous traversal to iterate and i'd imagine that causes the failure?

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/f646e240-63aa-4511-8ffd-ca35b6411b04n%40googlegroups.com.

Zhou Li

unread,
Feb 21, 2022, 6:50:23 AM2/21/22
to Gremlin-users

not the anonymous traversal problem, the query like this already has problem, and the two query in gremlin client has no problem.

g.V(14012536).as_('start').repeat(__.timeLimit(2000).both()).until(__.loops().is_(1)).dedup().as_('a').limit(__.select('a').hasId(288854240, 295903304, 290861088).count().toList()).toList()
Reply all
Reply to author
Forward
0 new messages