dlt.extract.incremental.sql
to_sqlglot_filter
def to_sqlglot_filter(
incremental: "Incremental[Any]",
apply_lag: bool = True,
destination_capabilities: Optional[DestinationCapabilitiesContext] = None
) -> Optional[sge.Expression]
Build a sqlglot WHERE expression that filters rows to the current incremental window.
Arguments:
incrementalIncremental[Any] - Incremental instance whose cursor is filtered. Works on bound and unbound instances.apply_lagbool - When True, lag is applied to the lower bound; when False, the raw cachedstart_valueis used.destination_capabilitiesOptional[DestinationCapabilitiesContext] - Caps used to shape the timestamp cast and literal format (precision, tz handling, sqlite cast drop). WhenNone, a generic tz-aware cast is emitted.
Returns:
Optional[sge.Expression]- A sqlglot boolean expression suitable for use as a WHERE clause, orNonewhen filtering is not possible.