What's new
Added
-
MetricCompute.scan() — pre-flight compatibility scan that introspects source table schemas and returns a ScanResult with one CompatibilityResult per metric × slice and per metric × segment pair. Schema introspection is batched by unique source URI.
-
CompatibilityResult — frozen dataclass carrying the compatibility verdict for a single metric × spec pair: compatible, valid_join_keys, missing_columns, and reason.
-
ScanResult — container for the full compatibility matrix with query helpers: compatible_slices(), compatible_segments(), compatible_metrics(), for_metric(), and for_spec().
Quick example
mc = MetricCompute(cache, conn)
result = mc.scan()
compatible_slices = result.compatible_slices("ctr") # ["campaign_type", "country"]
compatible_segs = result.compatible_segments("ctr") # ["platform"]
df = mc.compute(metrics="ctr", slices=compatible_slices)