Skip to content

Retrieving parents sometimes returns duplicate entries.

Created by: Quazgar

Example in Python:

db.get_connection()
A = db.RecordType(name="A")
B = db.RecordType(name="B")
C = db.RecordType(name="C")

B.add_parent(A)

# This order is important for the test to fail.
C.add_parent(B)
C.add_parent(C)
C.add_parent(A)

c = db.Container()
# c.extend([C, B, A])  # worked before #86 was fixed
# c.extend([C, A, B])  # worked before #86 was fixed
c.extend([B, C, A])    # insert() failed before #86 was fixed
c.insert()  # Raised java.sql.SQLIntegrityConstraintViolationException:
C1 =db.Entity(name="C").retrieve()
pids = [p.id for p in C1.parents]
if len(np.unique(pids)) == len(pids):
  print("Everything as expected")
else:
  print("Duplicate parents")

@timm.fitschen Is this actually a bug or just unexpected by me?

Imported comments:

By Quazgar on 2020-05-06T09:41:12.410Z

closed

By Quazgar on 2020-04-27T12:16:10.258Z

mentioned in merge request !11 (merged)

By Quazgar on 2020-04-27T11:52:00.156Z

mentioned in commit 1cdf2125

By Quazgar on 2020-04-15T16:11:47.273Z

assigned to @quazgar

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