Skip to main content
Version: 1.26.0 (latest)

dlt._workspace.deployment.freshness

Freshness constraint parsing, creators, and normalization.

TFreshnessConstraintSpec Objects

class TFreshnessConstraintSpec(NamedTuple)

View source on GitHub

type

noqa: A003

parse_freshness_constraint

def parse_freshness_constraint(constraint: str) -> TFreshnessConstraintSpec

View source on GitHub

Parse a freshness constraint string. Returns type and upstream job_ref.

is_matching_interval_fresh

def is_matching_interval_fresh(job_ref: str) -> TFreshnessConstraint

View source on GitHub

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

View source on GitHub

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

View source on GitHub

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]

View source on GitHub

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]

View source on GitHub

All job_refs whose freshness list mentions upstream_ref.

Arguments:

  • upstream_ref - The upstream job reference to look up.
  • all_jobs - Map of job_ref to job definition.

Returns:

  • List[str] - Direct downstream job refs in all_jobs iteration order. upstream_ref itself is never included.

get_transitive_freshness_downstream

def get_transitive_freshness_downstream(
upstream_ref: str, all_jobs: Mapping[str,
TJobDefinition]) -> List[str]

View source on GitHub

Breadth-first search through freshness edges from upstream_ref.

Arguments:

  • upstream_ref - The upstream job reference to start the walk from.
  • all_jobs - Map of job_ref to job definition.

Returns:

  • List[str] - All transitively reachable downstream job refs, in breadth-first search order. upstream_ref itself 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]

View source on GitHub

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 of job_ref to TJobDefinition.

Returns:

  • List[str] - Breadth-first search ordered downstream refs, excluding the root, refresh="block" nodes, and interval-store-eligible jobs.

This demo works on codespaces. Codespaces is a development environment available for free to anyone with a Github account. You'll be asked to fork the demo repository and from there the README guides you with further steps.
The demo uses the Continue VSCode extension.

Off to codespaces!

DHelp

Ask a question

Welcome to "Codex Central", your next-gen help center, driven by OpenAI's GPT-4 model. It's more than just a forum or a FAQ hub – it's a dynamic knowledge base where coders can find AI-assisted solutions to their pressing problems. With GPT-4's powerful comprehension and predictive abilities, Codex Central provides instantaneous issue resolution, insightful debugging, and personalized guidance. Get your code running smoothly with the unparalleled support at Codex Central - coding help reimagined with AI prowess.