graflo.hq.sanitizer¶
Sanitization entry point for schema and ingestion contracts.
:class:Sanitizer is the public, stand-alone, DB-flavor-aware orchestrator
that encodes the policy "sanitize this manifest for a given target DB flavor".
It owns no mutation logic of its own. Instead, it builds a list of
:mod:graflo.architecture.evolution ops and applies them to the manifest in
place, preserving the long-standing
:meth:Sanitizer.sanitize_manifest API for callers that prefer a one-liner
over assembling ops by hand.
Examples¶
Sanitize an inferred manifest a posteriori for TigerGraph::
from graflo.hq.sanitizer import Sanitizer
from graflo.onto import DBType
Sanitizer(DBType.TIGERGRAPH).sanitize_manifest(manifest)
Equivalent low-level call (skip the policy layer)::
from graflo.architecture.evolution import SanitizeOp, apply_sanitize
apply_sanitize(manifest, SanitizeOp(db_flavor=DBType.TIGERGRAPH))
Attributes¶
logger = logging.getLogger(__name__)
module-attribute
¶
Classes¶
Sanitizer
¶
DB-flavor-aware orchestrator for manifest sanitization.
The class encodes the per-flavor policy ("which evolution ops sanitize a
manifest for db_flavor") and applies them in place. Callers that want a
different sanitization recipe can either subclass and override
:meth:build_ops or build ops directly via
:mod:graflo.architecture.evolution.
Source code in graflo/hq/sanitizer.py
Attributes¶
db_flavor = db_flavor
instance-attribute
¶
Methods:¶
__init__(db_flavor)
¶
build_ops(manifest, *, reserved_words=None)
¶
Return the ordered list of evolution ops that sanitize manifest.
Today the list collapses to [SanitizeOp(db_flavor=...)]; exposing
it as a list keeps the door open for future per-flavor composition
(e.g. flavor-specific identity-normalization variants, future
rename-relation ops).
Source code in graflo/hq/sanitizer.py
sanitize_manifest(manifest)
¶
Mutate manifest in place per :meth:build_ops and return it.
Returns the same manifest object so callers can chain or simply assert that the in-place result is the original input.