Code Monkey home page Code Monkey logo

Comments (2)

viktorrobin avatar viktorrobin commented on September 21, 2024

So I found what was causing the issue, but can't really explain it...

I am using your migrate.py provided in the phone calls example, which randomly returns the error described above when grakn runs as a container:

def build_phone_call_graph(inputs):
    with GraknClient(uri=URI) as client:
        with client.session(keyspace = KEYSPACE) as session:
            for input in inputs:
                print("Loading from [" + input["data_path"] + "] into Grakn ...")
                load_data_into_grakn(input, session)
             
            
def load_data_into_grakn(input, session):
    items = parse_data_to_dictionaries(input)

    for item in items:
        with session.transaction().write() as transaction:
            graql_insert_query = input["template"](item)
            print("Executing Graql Query: " + graql_insert_query)
            transaction.query(graql_insert_query)
            transaction.commit()

    print("\nInserted " + str(len(items)) + " items from [ " + input["data_path"] + "] into Grakn.\n")

However, if you write the same thing this way, by simply not passing the session to the function, the error completely disappear...

def build_phone_call_graph(inputs):
    with GraknClient(uri=URI) as client:
        with client.session(keyspace = KEYSPACE) as session:
            for input in inputs:
                print("Loading from [" + input["data_path"] + "] into Grakn ...")
            
                # load_data_into_grakn(input, session)
                items = parse_data_to_dictionaries(input)

                for item in items:
                    with session.transaction().write() as transaction:
                        graql_insert_query = input["template"](item)
                        print("Executing Graql Query: " + graql_insert_query)
                        transaction.query(graql_insert_query)
                        transaction.commit()

                print("\nInserted " + str(len(items)) + " items from [ " + input["data_path"] + "] into Grakn.\n")

Can't explain why... Only happens with docker.

from typedb-driver-python.

haikalpribadi avatar haikalpribadi commented on September 21, 2024

Thanks for reporting this issue, @viktorrobin. Given how old this issue is from Grakn 1.5, and that we have rewritten Grakn in the 2.0 release (and renamed it to TypeDB), we do not believe this issue still exist and will close this now.

from typedb-driver-python.

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.