airflow_config.DAG¶
- class airflow_config.DAG(config: Configuration = None, **kwargs)[source]¶
Bases:
DAG
- __init__(config: Configuration = None, **kwargs)[source]¶
Method generated by attrs for class DAG.
Methods
__init__
([config])Method generated by attrs for class DAG.
add_task
(task)Add a task to the DAG.
add_tasks
(tasks)Add a list of tasks to the DAG.
bulk_write_to_db
(bundle_name, ...[, session])Ensure the DagModel rows for the given dags are up-to-date in the dag table in the DB.
clear
([exclude_run_ids])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
(*, run_id[, logical_date, ...])Create a run for this DAG to run its tasks.
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.
fetch_dagrun
(dag_id, run_id[, session])Return the dag run for a given run_id if it exists, otherwise none.
from_sdk_dag
(dag)Create a new (Scheduler) DAG object from a TaskSDKDag.
get_active_runs
()Return a list of dag run logical dates currently running.
get_bundle_name
([session])Return the bundle name this DAG is in.
get_bundle_version
([session])Return the bundle version that was seen when this dag was processed.
get_concurrency_reached
([session])Return a boolean indicating whether the max_active_tasks limit for this DAG has been reached.
get_dagrun
(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_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_is_stale
([session])Return a boolean indicating whether this DAG is stale.
get_last_dagrun
([session, ...])get_latest_logical_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_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_task
(task_id)get_task_assets
([inlets, outlets, of_type])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.
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.
iter_dagrun_infos_between
(earliest, latest, *)Yield DagRunInfo using this DAG's timetable between given interval.
logger
()Return a logger.
next_dagrun_info
(last_automated_dagrun, *[, ...])Get information about the next DagRun of this dag after
date_last_automated_dagrun
.param
(name[, default])Return a DagParam object for current dag.
partial_subset
(task_ids[, ...])Return a subset of the current dag based on regex matching one or more tasks.
resolve_template_files
()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[, run_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.
sync_to_db
([session])Save attributes about this DAG to the DB.
test
([run_after, logical_date, run_conf, ...])Execute one single DagRun for a given DAG and logical date.
topological_sort
()Sorts tasks in topographical order, such that a task comes after any of its upstream dependencies.
validate
()Validate the DAG has a coherent setup.
validate_executor_field
()validate_setup_teardown
()Validate that setup and teardown tasks are configured properly.
Attributes
dag_id
folder
Folder location of where the DAG object is instantiated.
get_serialized_fields
leaves
Return nodes with no children.
log
Return a logger.
owner
Return list of all owners found in DAG tasks.
roots
Return nodes with no parents.
safe_dag_id
task
task_group_dict
task_ids
tasks
tasks_upstream_of_teardowns
teardowns
timetable_summary
partial
last_loaded
max_consecutive_failed_dag_runs
description
default_args
start_date
end_date
timezone
schedule
timetable
template_searchpath
template_undefined
user_defined_macros
user_defined_filters
max_active_tasks
max_active_runs
dagrun_timeout
sla_miss_callback
catchup
on_success_callback
on_failure_callback
doc_md
params
access_control
is_paused_upon_creation
jinja_environment_kwargs
render_template_as_native_obj
tags
owner_links
auto_register
fail_fast
dag_display_name
task_dict
task_group
fileloc
relative_fileloc
edge_info
has_on_success_callback
has_on_failure_callback
disable_bundle_versioning