dlt._workspace.deployment.freshness
Freshness constraint parsing, creators, and normalization.
TFreshnessConstraintSpec Objects
class TFreshnessConstraintSpec(NamedTuple)
type
noqa: A003
parse_freshness_constraint
def parse_freshness_constraint(constraint: str) -> TFreshnessConstraintSpec
Parse a freshness constraint string. Returns type and upstream job_ref.
is_matching_interval_fresh
def is_matching_interval_fresh(job_ref: str) -> TFreshnessConstraint
Downstream interval must be fully covered by upstream completed intervals.
Arguments:
job_ref- Upstream job reference.
is_fresh
def is_fresh(job_ref: str) -> TFreshnessConstraint
Upstream overall interval (intersected with downstream's) must be complete.
Arguments:
job_ref- Upstream job reference.
normalize_freshness_constraint
def normalize_freshness_constraint(
constraint: Union[str, TFreshnessConstraint]) -> TFreshnessConstraint
Validate and normalize a single freshness constraint to canonical form.
normalize_freshness_constraints
def normalize_freshness_constraints(
constraints: Union[
None,
str,
TFreshnessConstraint,
Sequence[Union[str, TFreshnessConstraint]],
]
) -> List[TFreshnessConstraint]
Normalize freshness constraint input to a list of canonical values.
get_direct_freshness_downstream
def get_direct_freshness_downstream(
upstream_ref: str, all_jobs: Mapping[str,
TJobDefinition]) -> List[str]
All job_refs whose freshness list mentions upstream_ref.
Arguments:
upstream_ref- The upstream job reference to look up.all_jobs- Map ofjob_refto job definition.
Returns:
List[str]- Direct downstream job refs inall_jobsiteration order.upstream_refitself is never included.
get_transitive_freshness_downstream
def get_transitive_freshness_downstream(
upstream_ref: str, all_jobs: Mapping[str,
TJobDefinition]) -> List[str]
Breadth-first search through freshness edges from upstream_ref.
Arguments:
upstream_ref- The upstream job reference to start the walk from.all_jobs- Map ofjob_refto job definition.
Returns:
List[str]- All transitively reachable downstream job refs, in breadth-first search order.upstream_refitself is excluded even if reachable via a cycle.
get_refresh_cascade_targets
def get_refresh_cascade_targets(
root_ref: str, all_jobs: Mapping[str, TJobDefinition]) -> List[str]
Jobs to which a refresh signal initiated at root_ref propagates.
Walks the freshness graph downstream from root_ref and returns the
affected job refs. The root itself is excluded — callers handle it
separately.
Arguments:
root_ref- The job ref initiating the cascade.all_jobs- Map ofjob_reftoTJobDefinition.
Returns:
List[str]- Breadth-first search ordered downstream refs, excluding the root,refresh="block"nodes, and interval-store-eligible jobs.