class documentation

class RecordChangeRenderer(ChangeRenderer):

View In Hierarchy

Render Changes as structured record dicts (the records format).

Each dict follows the Data/Interface Contract key table:

  • target (always present): dotted path — "ClassName" or "ClassName.propName" (current name).
  • kind (always present): "class", "property", or "metadata".
  • op (always present): one of added, removed, modified, renamed, reordered, subclass_created.
  • from (renames only): previous name (mapped from Change.from_).
  • to (renames only): new name (mapped from Change.to).
  • fields (modified/renamed with field changes only): list of {"field": str, "before": Any, "after": Any} entries.
  • detail (compound/label/reorder only): the annotation dict.

Keys are omitted (not None) when they do not apply to a given entry, keeping records compact and stable. This is a flat one-record-per-Change mapping in the supplied sorted order — identical ordering to the text format.

Method render Render changes as a deterministic list of record dicts.
Method _to_record Convert a single Change to its record dict, omitting inapplicable keys.
Constant _INTERNAL_DETAIL_KEYS Internal-only detail keys that are pipeline artefacts, not part of the published records contract, and so are stripped from emitted records.
def render(self, changes: list[Change]) -> list[dict]:

Render changes as a deterministic list of record dicts.

Parameters
changes:list[Change]Ordered Change instances (already sorted).
Returns
list[dict]Deterministic list of record dicts.
def _to_record(self, ch: Change) -> dict:

Convert a single Change to its record dict, omitting inapplicable keys.

_INTERNAL_DETAIL_KEYS: frozenset[str] =

Internal-only detail keys that are pipeline artefacts, not part of the published records contract, and so are stripped from emitted records.

Value
frozenset(set(['reorder_candidate', 'before_order', 'after_order']))