Skip to content

Airflow

laktory.models.pipeline.AirflowOrchestrator ¤

Bases: PipelineChild

Airflow used as an orchestrator to execute a Laktory pipeline.

Examples:

import laktory as lk

o = lk.models.AirflowOrchestrator(
    description="A Laktory pipeline",
    schedule={
        "cron": "0 0 * * *",
        "timezone": "utc",
    },
    start_date="2026-03-03",
    max_active_runs=1,
)
print(o)
'''
dataframe_backend_=None dataframe_api_=None type='AIRFLOW' description='A Laktory pipeline' schedule=CronSchedule(variables={}, cron='0 0 * * *', timezone='utc') start_date=datetime.datetime(2026, 3, 3, 0, 0, tzinfo=datetime.timezone.utc) end_date=None template_searchpath=None user_defined_macros=None user_defined_filters=None default_args=None max_active_tasks=None max_active_runs=1 max_consecutive_failed_dag_runs=None dagrun_timeout=None catchup=None doc_md=None access_control=None is_paused_upon_creation=None jinja_environment_kwargs=None render_template_as_native_obj=None tags=None owner_links=None auto_register=None fail_fast=None dag_display_name=None disable_bundle_versioning=None dataframe_backend=<DataFrameBackends.PYSPARK: 'PYSPARK'> dataframe_api='NARWHALS'
'''
References
PARAMETER DESCRIPTION
access_control

Access control configuration defining roles and permissions for this DAG.

TYPE: dict[str, dict[str, list[str]]] | dict[str, list[str]] | VariableType DEFAULT: None

auto_register

Whether the DAG should automatically be registered when parsed by Airflow.

TYPE: bool | VariableType DEFAULT: None

catchup

Whether the scheduler should create DAG runs for all past schedule intervals between the start date and the current time.

TYPE: bool | VariableType DEFAULT: None

dag_display_name

Human-friendly name displayed in the Airflow UI instead of the DAG ID.

TYPE: str | VariableType DEFAULT: None

dagrun_timeout

Maximum time allowed for a DAG run to complete before it is marked as failed.

TYPE: str | timedelta | VariableType DEFAULT: None

default_args

Dictionary of default arguments applied to all tasks in the DAG unless overridden.

TYPE: dict[str | VariableType, Any | VariableType] | VariableType DEFAULT: None

description

Optional human-readable description of the DAG.

TYPE: str | VariableType DEFAULT: None

disable_bundle_versioning

If enabled, disables versioning of DAG bundles when deploying.

TYPE: bool | VariableType DEFAULT: None

doc_md

Markdown documentation displayed in the Airflow UI for the DAG.

TYPE: str | VariableType DEFAULT: None

end_date

Optional date after which no new DAG runs will be scheduled.

TYPE: datetime | VariableType DEFAULT: None

fail_fast

If enabled, the DAG run will stop scheduling new tasks as soon as a task fails.

TYPE: bool | VariableType DEFAULT: None

is_paused_upon_creation

Whether the DAG should be paused when first created.

TYPE: bool | VariableType DEFAULT: None

jinja_environment_kwargs

Additional keyword arguments used when creating the Jinja template environment.

TYPE: dict | VariableType DEFAULT: None

max_active_runs

Maximum number of active DAG runs allowed at the same time.

TYPE: int | VariableType DEFAULT: None

max_active_tasks

Maximum number of task instances allowed to run concurrently across all DAG runs.

TYPE: int | VariableType DEFAULT: None

max_consecutive_failed_dag_runs

Number of consecutive failed DAG runs allowed before the DAG is automatically paused.

TYPE: int | VariableType DEFAULT: None

owner_links

Mapping of DAG owners to URLs that provide additional information about them.

TYPE: dict[str | VariableType, str | VariableType] | VariableType DEFAULT: None

render_template_as_native_obj

If true, Jinja templates will render native Python objects instead of strings.

TYPE: bool | VariableType DEFAULT: None

schedule

Schedule that defines when the DAG should run. Uses a cron expression and timezone.

TYPE: CronSchedule | VariableType DEFAULT: None

start_date

The earliest date from which the scheduler will start creating DAG runs.

TYPE: datetime | VariableType DEFAULT: None

tags

Tags used to organize and filter DAGs in the Airflow UI.

TYPE: list[str | VariableType] | VariableType DEFAULT: None

template_searchpath

Directories to search for template files referenced in templated fields.

TYPE: str | list[str] | VariableType DEFAULT: None

type

Type of orchestrator

TYPE: Literal['AIRFLOW'] | VariableType DEFAULT: 'AIRFLOW'

user_defined_filters

Custom Jinja filters available when rendering templated fields.

TYPE: dict | VariableType DEFAULT: None

user_defined_macros

Custom macros made available in the Jinja template context for all tasks in the DAG.

TYPE: dict | VariableType DEFAULT: None


laktory.models.pipeline.orchestrators.airfloworchestrator.CronSchedule ¤

Bases: BaseModel

Cron Schedule.

PARAMETER DESCRIPTION
cron

Cron expression defining when the DAG should be scheduled to run.

TYPE: str | VariableType

timezone

Timezone used to interpret the cron schedule.

TYPE: str | VariableType DEFAULT: 'utc'