Skip to content

RecordTypes with name duplicates cannot be used as list datatype

Summary

In a setting where there is both a Property, and a RecordType with the same name, the latter can't be used as a LIST datatype even when specified by id. Instead, an EntityError: This data type cannot be identified due to name duplicates. is raised.

Expected Behavior

Even with name duplicates, the server should understand the datatype when specified by id.

Actual Behavior

It doesn't. Instead, the following error is raised:

TransactionError: TransactionError: An error occured during the transaction.
    +--| REASONS |--
    |  -> RECORD (id: 102, name: 'TestRec') CAUSED     |EntityError
    |    +--| REASONS |--
    |    |  -> PROPERTY (id: 101, name: 'Test') CAUSED     |    |EntityError: This data type cannot be identified due to name duplicates.
    |    +----------------
    +----------------

Steps to Reproduce the Problem

import caosdb as db
prop = db.Property(name="Test", datatype=db.TEXT).insert()
rt = db.RecordType(name="Test").insert(unique=False)
rec = db.Record(name="TestRec").add_parent(id=rt.id).insert()  # Here, specifying rt by id works
rec.add_property(id=rt.id).update()  # Here, too
rec.add_property(id=rt.id, datatype=db.LIST(rt.id)).update()  # This fails

Specifications

  • Version: LinkAhead 0.10, caosdb-server 0.12.0, caosdb-pylib 0.12.1
  • Platform: Arch Linux, Python 3.11.3
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information