Skip to content

temporal_inference

sqllocks_spindle.schema.inference.temporal_inference

Upgrade temporal columns from uniform to context-appropriate date/time patterns.

Transaction dates get seasonal Q4 bias and weekday weighting, end dates become derived from their paired start date, and birth dates get an age-appropriate range. Audit and generic timestamps are left as uniform.

Classes

TemporalPatternInferrer

Upgrade temporal column generators based on column and table semantics.

Applies the following rules:

  • TEMPORAL_TRANSACTION on TRANSACTION tables: seasonal with Q4 bias and weekday weighting.
  • TEMPORAL_AUDIT: kept as uniform (audit timestamps have no seasonality).
  • TEMPORAL_START: kept as uniform within the model date range.
  • TEMPORAL_END: derived from the nearest TEMPORAL_START column in the same table via an add_days rule.
  • TEMPORAL_BIRTH: uniform with a custom range (65 years to 18 years before the model end date).
  • TEMPORAL_GENERIC: kept as uniform.