Skip to main content
Version: 1.26.0 (latest)

dlt._workspace.deployment._trigger_helpers

parse_period_seconds

def parse_period_seconds(value: str) -> float

View source on GitHub

Parse a human period string (e.g. '5m', '1h', '30s') into seconds.

Also accepts bare numeric strings as seconds.

Raises:

  • ValueError - If the string cannot be parsed.

normalize_timeout

def normalize_timeout(
value: Union[int, float, str, TTimeoutSpec]) -> TTimeoutSpec

View source on GitHub

Normalize timeout input to TTimeoutSpec for the manifest.

parse_trigger

def parse_trigger(trigger: TTrigger) -> TParsedTrigger

View source on GitHub

Parse a normalized trigger string into a structured TParsedTrigger.

normalize_trigger

def normalize_trigger(trigger: Union[str, TTrigger]) -> TTrigger

View source on GitHub

Normalize a single user-provided trigger to canonical form.

Raises InvalidTrigger for manual: and pipeline_name: triggers which are synthetic (added automatically from expose and deliver specs).

normalize_triggers

def normalize_triggers(
trigger: Union[None, str, TTrigger, Sequence[Union[str, TTrigger]],
Tuple[Union[str, TTrigger], ...]]
) -> List[TTrigger]

View source on GitHub

Normalize trigger input to a list of canonical TTrigger values.

is_selector

def is_selector(s: str) -> bool

View source on GitHub

Check if string looks like a trigger selector vs a bare job ref.

match_triggers_with_selectors

def match_triggers_with_selectors(job_type: str, triggers: List[TTrigger],
selectors: List[str]) -> List[TTrigger]

View source on GitHub

Return triggers that match any selector.

Job-type selectors (batch, interactive, stream, job) match ALL triggers.

pick_trigger

def pick_trigger(
matched: List[TTrigger],
default_trigger: Optional[TTrigger] = None) -> Optional[TTrigger]

View source on GitHub

Pick one trigger from a matched list. Prefer default_trigger if present.

maybe_parse_schedule

def maybe_parse_schedule(job_def: TJobDefinition) -> Optional[str]

View source on GitHub

Extract the cron expression from a job's schedule trigger.

Returns:

The cron expression string if the job has a schedule: trigger, or None if no schedule trigger is found.

humanize_trigger

def humanize_trigger(trigger: TTrigger) -> str

View source on GitHub

Human-readable description of a trigger string for display in CLIs.

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.