graflo.architecture.evolution.sanitize¶
Internal helpers for :class:~graflo.architecture.evolution.ops.SanitizeOp.
Hosts the analytic / planning side of sanitization: pure functions that compute which fields must be renamed and the per-vertex field rewrite map produced by TigerGraph's "consistent identity per relation" constraint.
The actual mutation lives in
:mod:graflo.architecture.evolution.apply (apply_sanitize and
apply_rename_vertex_properties) so the same code paths drive both
SanitizeOp and the standalone RenameVertexPropertiesOp.
compute_vertex_field_renames(schema, reserved_words)
¶
Compute per-vertex field rename map for a flavor's reserved-word set.
Pure: returns {vertex_name: {old_field: new_field}} without mutating
schema. Vertices/fields whose names are not reserved are absent from
the result.
Source code in graflo/architecture/evolution/sanitize.py
normalize_relation_identity(schema, db_flavor)
¶
For TigerGraph: align identity fields across edges sharing a relation.
Returns a per-vertex {old_field: new_field} map describing the schema-
side changes performed. Caller is responsible for propagating the same
map to ingestion via rewrite_vertex_field_names_in_pipeline.
For non-TigerGraph flavors this is a no-op and returns an empty dict.