DeanLight / spannerlib

https://deanlight.github.io/spannerlib/
Apache License 2.0
3 stars 1 forks source link

RuntimeError: dictionary changed size during iteration Bug in rgxlog #105

Closed mahmouddiab2000 closed 1 year ago

mahmouddiab2000 commented 1 year ago

We were executing code with similar logic and encountered this error: 'RuntimeError: dictionary changed size during iteration.'"

Simple code to reproduce the bug:

import rgxlog
from rgxlog import magic_session
from rgxlog import Session
from rgxlog.engine.datatypes.primitive_types import DataTypes
session = rgxlog.magic_session

def dummy(query_string):
    results = session.run_commands(query_string, print_results=True, format_results=True)
    replacements = results[0].values.tolist()
    yield "dummy"
magic_session.register(ie_function=dummy,
                       ie_function_name = "dummy",
                       in_rel=[DataTypes.string],
                       out_rel=[DataTypes.string])

%%rgxlog
new Dummy_rule(str,str)
Dummy_rule("a","b")
query_string = "?Dummy_rule(A,B)"
Tmp_Table(X) <- dummy(query_string) -> (X)
?Tmp_Table(X)

When executing the code we were able to get the query results, but also got this error: Error stack.txt

Priority: critical

mahmouddiab2000 commented 1 year ago

after discussing with the team it's not actually a bug, we are trying to add commands to session while executing command in the session