Metric (ABC) # metrics/core.py
│
├── StaticMetric # SQL aggregate functions
│ fn(col, ...) → SQLAlchemy expression # e.g., func.count(), func.avg()
│ Examples: Count, NullCount, Min, Max, Mean, Sum, StdDev,
│ DistinctCount, UniqueCount, MinLength, MaxLength
│
├── QueryMetric # Full query execution
│ query(col, ...) → SQLAlchemy Select # Returns multiple rows
│ Examples: LikeCount, RegexCount
│
├── ComposedMetric # Derived from other metrics
│ fn(results) → value # Pure computation, no DB query
│ Examples: NullRatio, DistinctRatio, UniqueRatio,
│ DuplicateCount, InterQuartileRange
│
├── HybridMetric # Query + prior results
│ query(col, ...) → Select # Needs results from earlier metrics
│ fn(results) → value
│ Examples: Histogram, CardinalityDistribution
│
├── WindowMetric # Percentile-based (window functions)
│ fn(col, ...) → SQLAlchemy expression
│ Examples: Median, FirstQuartile, ThirdQuartile
│
├── CustomMetric # User-defined SQL
│ sql(col, ...) → raw SQL string
│
└── SystemMetric # Database system-level
│ sql(col, ...) → dialect-specific query
│ Examples: DML operation counts, freshness