dlt.extract.incremental.lag
apply_lag
def apply_lag(lag: float, initial_value: TCursorValue,
last_value: TCursorValue,
last_value_func: LastValueFunc[TCursorValue]) -> TCursorValue
Applies lag to last_value but prevents it to cross initial_value: observing order of last_value_func
apply_lag_with_suppression
def apply_lag_with_suppression(
lag: Optional[float],
last_value_func: LastValueFunc[TCursorValue],
initial_value: Optional[TCursorValue],
end_value: Optional[TCursorValue],
last_value: Optional[TCursorValue],
resource_name: Optional[str] = None) -> Optional[TCursorValue]
Conditionally apply lag to last_value, mirroring Incremental.last_value rules.
Returns last_value unchanged when:
lagis falsy orlast_valueis Nonelast_value_funcis notmaxormin(logs warning)end_valueis set (lag auto-deactivated; logs info)