airflow_config.DAG¶
- class airflow_config.DAG(config: Configuration = None, **kwargs)[source]¶
Bases:
DAG
- __init__(config: Configuration = None, **kwargs)[source]¶
Methods
__init__
([config])add_task
(task)Add a task to the DAG.
add_tasks
(tasks)Add a list of tasks to the DAG.
bulk_sync_to_db
(dags[, session])Use airflow.models.DAG.bulk_write_to_db, this method is deprecated.
bulk_write_to_db
(dags[, processor_subdir, ...])Ensure the DagModel rows for the given dags are up-to-date in the dag table in the DB.
clear
([task_ids, start_date, end_date, ...])Clear a set of task instances associated with the current dag for a specified date range.
clear_dags
(dags[, start_date, end_date, ...])cli
()Exposes a CLI specific to this DAG.
create_dagrun
(state[, execution_date, ...])Create a dag run from this dag including the tasks associated with this dag.
date_range
(start_date[, num, end_date])deactivate_stale_dags
(expiration_date[, session])Deactivate any DAGs that were last touched by the scheduler before the expiration date.
deactivate_unknown_dags
(active_dag_ids[, ...])Given a list of known DAGs, deactivate any other DAGs that are marked as active in the ORM.
execute_callback
(callbacks, context, dag_id)Triggers the callbacks with the given context.
fetch_callback
(dag, dag_run_id[, success, ...])Fetch the appropriate callbacks depending on the value of success.
fetch_dagrun
(dag_id[, execution_date, ...])Return the dag run for a given execution date or run_id if it exists, otherwise none.
following_schedule
(dttm)Calculate the following schedule for this dag in UTC.
get_active_runs
()Return a list of dag run execution dates currently running.
get_concurrency_reached
([session])Return a boolean indicating whether the max_active_tasks limit for this DAG has been reached.
get_dagrun
([execution_date, run_id, session])get_dagruns_between
(start_date, end_date[, ...])Return the list of dag runs between start_date (inclusive) and end_date (inclusive).
get_default_view
()Allow backward compatible jinja2 templates.
get_doc_md
(doc_md)get_edge_info
(upstream_task_id, ...)Return edge information for the given pair of tasks or an empty edge if there is no information.
get_is_active
([session])Return a boolean indicating whether this DAG is active.
get_is_paused
([session])Return a boolean indicating whether this DAG is paused.
get_last_dagrun
([session, ...])get_latest_execution_date
([session])Return the latest date for which at least one dag run exists.
get_next_data_interval
(dag_model)Get the data interval of the next scheduled run.
get_num_active_runs
([external_trigger, ...])Return the number of active "running" dag runs.
get_num_task_instances
(dag_id[, run_id, ...])Return the number of task instances in the given DAG.
get_run_data_interval
(run)Get the data interval of this run.
get_run_dates
(start_date[, end_date])Return a list of dates between the interval received as parameter using this dag's schedule interval.
get_serialized_fields
()Stringified DAGs and operators contain exactly these fields.
get_task
(task_id[, include_subdags])get_task_instances
([start_date, end_date, ...])get_task_instances_before
(base_date, num, *)Get
num
task instances before (including)base_date
.get_template_env
(*[, force_sandboxed])Build a Jinja2 environment.
get_tree_view
()Return an ASCII tree representation of the DAG.
handle_callback
(dagrun[, success, reason, ...])Triggers on_failure_callback or on_success_callback as appropriate.
has_dag_runs
([session, ...])has_task
(task_id)has_task_group
(task_group_id)infer_automated_data_interval
(logical_date)Infer a data interval for a run against this DAG.
is_fixed_time_schedule
()Figures out if the schedule has a fixed time (e.g. 3 AM every day).
iter_dagrun_infos_between
(earliest, latest, *)Yield DagRunInfo using this DAG's timetable between given interval.
iter_invalid_owner_links
()Parse a given link, and verifies if it's a valid URL, or a 'mailto' link.
logger
()Return a logger.
next_dagrun_after_date
(...)next_dagrun_info
(last_automated_dagrun, *[, ...])Get information about the next DagRun of this dag after
date_last_automated_dagrun
.normalize_schedule
(dttm)param
(name[, default])Return a DagParam object for current dag.
partial_subset
(task_ids_or_regex[, ...])Return a subset of the current dag based on regex matching one or more tasks.
pickle
([session])pickle_info
()previous_schedule
(dttm)resolve_template_files
()run
([start_date, end_date, mark_success, ...])Run the DAG.
set_dag_runs_state
([state, session, ...])set_dependency
(upstream_task_id, ...)Set dependency between two tasks that already have been added to the DAG using add_task().
set_edge_info
(upstream_task_id, ...)Set the given edge information on the DAG.
set_task_group_state
(*, group_id[, ...])Set TaskGroup to the given state and clear downstream tasks in failed or upstream_failed state.
set_task_instance_state
(*, task_id[, ...])Set the state of a TaskInstance and clear downstream tasks in failed or upstream_failed state.
sub_dag
(*args, **kwargs)Use airflow.models.DAG.partial_subset, this method is deprecated.
sync_to_db
([processor_subdir, session])Save attributes about this DAG to the DB.
test
([execution_date, run_conf, ...])Execute one single DagRun for a given DAG and execution date.
topological_sort
([include_subdag_tasks])Sorts tasks in topographical order, such that a task comes after any of its upstream dependencies.
tree_view
()Print an ASCII tree representation of the DAG.
validate
()Validate the DAG has a coherent setup.
validate_executor_field
()validate_schedule_and_params
()Validate Param values when the DAG has schedule defined.
validate_setup_teardown
()Validate that setup and teardown tasks are configured properly.
Attributes
access_control
allow_future_exec_dates
concurrency
concurrency_reached
Use airflow.models.DAG.get_concurrency_reached, this attribute is deprecated.
dag_display_name
dag_id
default_view
description
filepath
Relative file path to the DAG.
folder
Folder location of where the DAG object is instantiated.
full_filepath
Full file path to the DAG.
is_paused
Use airflow.models.DAG.get_is_paused, this attribute is deprecated.
is_subdag
latest_execution_date
Use airflow.models.DAG.get_latest_execution_date, this attribute is deprecated.
leaves
Return nodes with no children.
log
Return a logger.
max_active_tasks
normalized_schedule_interval
owner
Return list of all owners found in DAG tasks.
parent_dag
pickle_id
relative_fileloc
File location of the importable dag 'file' relative to the configured DAGs folder.
roots
Return nodes with no parents.
subdags
Return a list of the subdag objects associated to this DAG.
task
task_group
task_group_dict
task_ids
tasks
tasks_upstream_of_teardowns
teardowns
fileloc
File path that needs to be imported to load this DAG or subdag.