Skip to main content
Version: V3 (Ignition 8.3)

tamaki.mes.backup.compare.compareEntityFields

Description

Compares two entities (dictionaries) field by field and identifies which fields were removed, added, or changed:

  • Removed: keys present in oldEntity but not newEntity.
  • Added: keys present in newEntity but not oldEntity.
  • Updated: keys present in both whose values differ (compared with equalValues).

Raises a TypeError if either argument is not a dictionary.

Syntax

tamaki.mes.backup.compare.compareEntityFields(oldEntity, newEntity)

Parameters

ParameterTypeNullableDescription
oldEntityDictFalseThe old state of the entity (field name → value).
newEntityDictFalseThe new state of the entity (field name → value).

Returns

A tuple (removedFields, addedFields, updatedFields) of ResultRow lists, with change types field remove, field add, and field update respectively.

Code Examples

oldLoc = {"path": "Site/A", "description": "Old", "enabled": True}
newLoc = {"path": "Site/A", "description": "New"}
removed, added, updated = tamaki.mes.backup.compare.compareEntityFields(oldLoc, newLoc)
# removed: [enabled], added: [], updated: [description]