Skip to content

compare_entities from apiutils does not compare entity values

Currently, the function compare_entities in caosdb.apiutils does not compare entity values.

import caosdb as db
from caosdb.apiutils import compare_entities

r1 = db.Record()
r2 = db.Record()
r1.add_parent("bla")
r2.add_parent("bla")
r1.add_parent("lopp")
r1.add_property("test", value=2)
r2.add_property("test", value=2)
r1.add_property("tests", value=3)
r2.add_property("tests", value=45)
r1.add_property("tests_234234", value=45)
r2.add_property("tests_TT", value=45)

compare_entities(r1, r2)

Output:

({'properties': {'tests_234234': {}}, 'parents': ['lopp']},
 {'properties': {'tests_TT': {}}, 'parents': []})

... although "tests" in both records differ.

Edited by Alexander Schlemmer
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information