airflow_config.Configuration¶
- pydantic model airflow_config.Configuration[source]¶
Bases:
BaseModel
Show JSON schema
{ "title": "Configuration", "type": "object", "properties": { "default_args": { "$ref": "#/$defs/TaskArgs", "description": "Global default default_args (task arguments)" }, "default_dag_args": { "$ref": "#/$defs/DagArgs", "description": "Global default dag arguments" }, "dags": { "default": null, "title": "Dags" }, "tasks": { "default": null, "title": "Tasks" }, "python": { "$ref": "#/$defs/PythonConfiguration", "description": "Global Python configuration" }, "extensions": { "anyOf": [ { "additionalProperties": { "$ref": "#/$defs/BaseModel" }, "type": "object" }, { "type": "null" } ], "description": "Any user-defined extensions", "title": "Extensions" } }, "$defs": { "BaseModel": { "properties": {}, "title": "BaseModel", "type": "object" }, "DagArgs": { "properties": { "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The description for the DAG to e.g. be shown on the webserver", "title": "Description" }, "schedule": { "anyOf": [ { "format": "duration", "type": "string" }, { "$ref": "#/$defs/RelativeDeltaAnnotation" }, { "const": "NOTSET", "enum": [ "NOTSET" ], "type": "string" }, { "type": "string" }, { "type": "null" } ], "default": null, "description": "Defines the rules according to which DAG runs are scheduled. Can accept cron string, timedelta object, Timetable, or list of Dataset objects. If this is not provided, the DAG will be set to the default schedule timedelta(days=1). See also Customizing DAG Scheduling with Timetables.", "title": "Schedule" }, "start_date": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "description": "The timestamp from which the scheduler will attempt to backfill", "title": "Start Date" }, "end_date": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "description": "A date beyond which your DAG won\u2019t run, leave to None for open-ended scheduling", "title": "End Date" }, "default_view": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Specify DAG default view (grid, graph, duration, gantt, landing_times), default grid", "title": "Default View" }, "orientation": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Specify DAG orientation in graph view (LR, TB, RL, BT), default LR", "title": "Orientation" }, "catchup": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "description": "Perform scheduler catchup (or only run latest)? Defaults to False", "title": "Catchup" }, "is_paused_upon_creation": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "description": "Specifies if the dag is paused when created for the first time. If the dag exists already, this flag will be ignored.", "title": "Is Paused Upon Creation" }, "tags": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "description": "List of tags to help filtering DAGs in the UI.", "title": "Tags" } }, "title": "DagArgs", "type": "object" }, "PythonConfiguration": { "properties": {}, "title": "PythonConfiguration", "type": "object" }, "RelativeDeltaAnnotation": { "properties": { "years": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Years" }, "months": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Months" }, "days": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Days" }, "hours": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Hours" }, "minutes": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Minutes" }, "seconds": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Seconds" }, "microseconds": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Microseconds" }, "year": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Year" }, "month": { "anyOf": [ { "maximum": 12, "minimum": 1, "type": "integer" }, { "type": "null" } ], "default": null, "title": "Month" }, "day": { "anyOf": [ { "maximum": 31, "minimum": 0, "type": "integer" }, { "type": "null" } ], "default": null, "title": "Day" }, "hour": { "anyOf": [ { "maximum": 23, "minimum": 0, "type": "integer" }, { "type": "null" } ], "default": null, "title": "Hour" }, "minute": { "anyOf": [ { "maximum": 59, "minimum": 0, "type": "integer" }, { "type": "null" } ], "default": null, "title": "Minute" }, "second": { "anyOf": [ { "maximum": 59, "minimum": 0, "type": "integer" }, { "type": "null" } ], "default": null, "title": "Second" }, "microsecond": { "anyOf": [ { "maximum": 999999, "minimum": 0, "type": "integer" }, { "type": "null" } ], "default": null, "title": "Microsecond" }, "weekday": { "anyOf": [ { "$ref": "#/$defs/WeekdayAnnotations" }, { "type": "null" } ], "default": null }, "leapdays": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Leapdays" }, "yearday": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Yearday" }, "nlyearday": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Nlyearday" }, "weeks": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Weeks" }, "dt1": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Dt1" }, "dt2": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Dt2" } }, "title": "RelativeDeltaAnnotation", "type": "object" }, "TaskArgs": { "properties": { "owner": { "default": "airflow", "description": "the owner of the task. Using a meaningful description (e.g. user/person/team/role name) to clarify ownership is recommended.", "title": "Owner", "type": "string" }, "email": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "description": "the 'to' email address(es) used in email alerts", "title": "Email" }, "email_on_failure": { "default": false, "description": "Indicates whether email alerts should be sent when a task failed", "title": "Email On Failure", "type": "boolean" }, "email_on_retry": { "default": false, "description": "Indicates whether email alerts should be sent when a task is retried", "title": "Email On Retry", "type": "boolean" }, "retries": { "default": 0, "description": "the number of retries that should be performed before failing the task", "title": "Retries", "type": "integer" }, "retry_delay": { "default": "PT5M", "description": "delay between retries", "format": "duration", "title": "Retry Delay", "type": "string" }, "start_date": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "description": "The start_date for the task, determines the execution_date for the first task instance. The best practice is to have the start_date rounded to your DAG\u2019s schedule_interval. Daily jobs have their start_date some day at 00:00:00, hourly jobs have their start_date at 00:00 of a specific hour. Note that Airflow simply looks at the latest execution_date and adds the schedule_interval to determine the next execution_date. It is also very important to note that different tasks\u2019 dependencies need to line up in time. If task A depends on task B and their start_date are offset in a way that their execution_date don\u2019t line up, A\u2019s dependencies will never be met. If you are looking to delay a task, for example running a daily task at 2AM, look into the TimeSensor and TimeDeltaSensor. We advise against using dynamic start_date and recommend using fixed ones. Read the FAQ entry about start_date for more information.", "title": "Start Date" }, "end_date": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "description": "if specified, the scheduler won\u2019t go beyond this date", "title": "End Date" }, "depends_on_past": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "description": "when set to true, task instances will run sequentially and only if the previous instance has succeeded or has been skipped. The task instance for the start_date is allowed to run.", "title": "Depends On Past" }, "queue": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "which queue to target when running this job. Not all executors implement queue management, the CeleryExecutor does support targeting specific queues.", "title": "Queue" }, "pool": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "the slot pool this task should run in, slot pools are a way to limit concurrency for certain tasks", "title": "Pool" }, "pool_slots": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "description": "the number of pool slots this task should use (>= 1) Values less than 1 are not allowed", "title": "Pool Slots" } }, "title": "TaskArgs", "type": "object" }, "WeekdayAnnotations": { "properties": { "weekday": { "maximum": 6, "minimum": 0, "title": "Weekday", "type": "integer" }, "n": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "N" } }, "required": [ "weekday" ], "title": "WeekdayAnnotations", "type": "object" } } }
- Fields:
dags (Dict[str, airflow_config.configuration.airflow.Dag] | None)
default_dag_args (airflow_config.configuration.airflow.DagArgs)
default_task_args (airflow_config.configuration.airflow.TaskArgs)
extensions (Dict[str, pydantic.main.BaseModel] | None)
python (airflow_config.configuration.python.PythonConfiguration)
tasks (Dict[str, airflow_config.configuration.airflow.Task] | None)
- field default_task_args: TaskArgs [Optional] (alias 'default_args')¶
Global default default_args (task arguments)
- field dags: Dict[str, Dag] | None [Optional]¶
List of dags statically configured via Pydantic
- field tasks: Dict[str, Task] | None [Optional]¶
List of dags statically configured via Pydantic
- field python: PythonConfiguration [Optional]¶
Global Python configuration
- field extensions: Dict[str, BaseModel] | None [Optional]¶
Any user-defined extensions
- property default_args¶
- static load(config_dir: str = 'config', config_name: str = '', overrides: list[str] | None = None, *, basepath: str = '', _offset: int = 3) Configuration [source]¶