Coder Social home page Coder Social logo

Comments (13)

tariqdaouda avatar tariqdaouda commented on June 3, 2024

Hi @gdg87,

I've just tried it and it seems to work. Could you give more information about the code that produced this error?

from pyarango.

gdg87 avatar gdg87 commented on June 3, 2024

Hi,
this is my function that produce this error

`postsCollection = db["posts"]
commentsCollection = db["comments"]
postlinksCollection = db["postlinks"]
posts = postsCollection.fetchByExample({'PostTypeId' : 2}, batchSize = 100)
for post in posts:
parent = postsCollection.fetchFirstExample({'Id': post['ParentId']})
if parent:
parentUID = parent[0]['OwnerUserId'];
G.add_edge(parent[0]['OwnerUserId'], post['OwnerUserId'], key='question_answer', weight=8)

        commentsParent = commentsCollection.fetchByExample({'PostId': parent[0]['Id']}, batchSize = 20)
        for commentParent in commentsParent:
            G.add_edge(parent[0]['OwnerUserId'], commentParent['UserId'], key='comment', weight=4)
    comments = commentsCollection.fetchByExample({'PostId': post['Id']}, batchSize = 20)
    for comment in comments:
        G.add_edge(post['OwnerUserId'], comment['UserId'], key='comment', weight=4)
    link = postlinksCollection.fetchFirstExample({'PostId': post['Id']})
    if link:
        linked = postsCollection.fetchFirstExample({'Id': link[0]['RelatedPostId']})
        G.add_edge(post['Id'], linked[0]['OwnerUserId'], key='link', weight=2)
return G`

from pyarango.

tariqdaouda avatar tariqdaouda commented on June 3, 2024

What happens if you do:

for post in posts:
    print post

from pyarango.

gdg87 avatar gdg87 commented on June 3, 2024

Print the object until it give the error

from pyarango.

tariqdaouda avatar tariqdaouda commented on June 3, 2024

I am not able able to reproduce the error. Can you tell me how many examples it prints before dying?

from pyarango.

gdg87 avatar gdg87 commented on June 3, 2024

If the batchSize is 100 it dies at 100 example, but if the batchSize is smaller it prints more examples. The number of examples printed is variable.

from pyarango.

tariqdaouda avatar tariqdaouda commented on June 3, 2024

If you at the look test here, it creates 100 users, as asks for them all with a batch size of 1 and tries to append 105 of them. Everything seems ok when I run it. Have you tried to update to the last github version? Can you run the test?

from pyarango.

gdg87 avatar gdg87 commented on June 3, 2024

The test works, but I have this error only when the number of documents in the collection is higher then 20000. Using collection with a limited number of documents I do not have any erorr.

from pyarango.

tariqdaouda avatar tariqdaouda commented on June 3, 2024

I have just tried it and it works for 20000 users.
Could you give me the contents of posts.request.status_code, and also posts.rawResults?

from pyarango.

gdg87 avatar gdg87 commented on June 3, 2024

Using posts.request.status_code or posts.rawResults it give me the above error with any batch size. Try to increase the number of users in your test I think that the limit number to reproduce the error depends also on the pc where the script run.

from pyarango.

tariqdaouda avatar tariqdaouda commented on June 3, 2024

I'm sorry request was not saved as an attribute. I've changed that now, but rawResults should have worked. I've tried it with 100,000 documents. The issue might not be directly related to pyArango, have you tried to update ArangoDB?

from pyarango.

gdg87 avatar gdg87 commented on June 3, 2024

Ok, I make a test removing the internal part of the for and it works. Maybe the problem is related with multiple query in a for, however I will change my code to avoid this error moving the other query out of the for.

from pyarango.

tariqdaouda avatar tariqdaouda commented on June 3, 2024

Ok, cool!

from pyarango.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.