Skip to content

Commit

Permalink
Check that the datastore record has the right class on read
Browse files Browse the repository at this point in the history
  • Loading branch information
timj committed Jun 29, 2023
1 parent ce5b439 commit fbf00cb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions python/lsst/daf/butler/core/datastoreRecordData.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,11 @@ def from_simple(
records[dataset_id] = {}
for class_name, table_data in simple.records.items():
klass = doImportType(class_name)
if not issubclass(klass, StoredDatastoreItemInfo):
raise RuntimeError(
"The class specified in the SerializedDatastoreRecordData "
f"({get_full_type_name(klass)}) is not a StoredDatastoreItemInfo."
)
for table_name, table_records in table_data.items():
for record in table_records:
info = klass.from_record(record)
Expand Down

0 comments on commit fbf00cb

Please sign in to comment.