blob: 8d75073f025097170988f26347f330d69dae05fc [file] [log] [blame]
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>airflow.models.dag &mdash; Airflow Documentation</title>
<script type="text/javascript" src="../../../../_static/js/modernizr.min.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="../../../../" src="../../../../_static/documentation_options.js"></script>
<script type="text/javascript" src="../../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../../_static/doctools.js"></script>
<script type="text/javascript" src="../../../../_static/language_data.js"></script>
<script type="text/javascript" src="../../../../_static/js/theme.js"></script>
<link rel="stylesheet" href="../../../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../../../_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="../../../../genindex.html" />
<link rel="search" title="Search" href="../../../../search.html" />
<link rel="next" title="airflow.models.dagbag" href="../dagbag/index.html" />
<link rel="prev" title="airflow.models.crypto" href="../crypto/index.html" />
<script>
document.addEventListener('DOMContentLoaded', function() {
var el = document.getElementById('changelog');
if (el !== null ) {
// [AIRFLOW-...]
el.innerHTML = el.innerHTML.replace(
/\[(AIRFLOW-[\d]+)\]/g,
`<a href="https://issues.apache.org/jira/browse/$1">[$1]</a>`
);
// (#...)
el.innerHTML = el.innerHTML.replace(
/\(#([\d]+)\)/g,
`<a href="https://github.com/apache/airflow/pull/$1">(#$1)</a>`
);
};
})
</script>
<style>
.example-header {
position: relative;
background: #9AAA7A;
padding: 8px 16px;
margin-bottom: 0;
}
.example-header--with-button {
padding-right: 166px;
}
.example-header:after{
content: '';
display: table;
clear: both;
}
.example-title {
display:block;
padding: 4px;
margin-right: 16px;
color: white;
overflow-x: auto;
}
.example-header-button {
top: 8px;
right: 16px;
position: absolute;
}
.example-header + .highlight-python {
margin-top: 0 !important;
}
.viewcode-button {
display: inline-block;
padding: 8px 16px;
border: 0;
margin: 0;
outline: 0;
border-radius: 2px;
-webkit-box-shadow: 0 3px 5px 0 rgba(0,0,0,.3);
box-shadow: 0 3px 6px 0 rgba(0,0,0,.3);
color: #404040;
background-color: #e7e7e7;
cursor: pointer;
font-size: 16px;
font-weight: 500;
line-height: 1;
text-decoration: none;
text-overflow: ellipsis;
overflow: hidden;
text-transform: uppercase;
-webkit-transition: background-color .2s;
transition: background-color .2s;
vertical-align: middle;
white-space: nowrap;
}
.viewcode-button:visited {
color: #404040;
}
.viewcode-button:hover, .viewcode-button:focus {
color: #404040;
background-color: #d6d6d6;
}
</style>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../../../index.html" class="icon icon-home"> Airflow
</a>
<div class="version">
1.10.4
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../../project.html">Project</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../license.html">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../start.html">Quick Start</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../tutorial.html">Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../howto/index.html">How-to Guides</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../ui.html">UI / Screenshots</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../concepts.html">Concepts</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../profiling.html">Data Profiling</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../cli.html">Command Line Interface</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../scheduler.html">Scheduling &amp; Triggers</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../plugins.html">Plugins</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../security.html">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../timezone.html">Time zones</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../api.html">Experimental Rest API</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../integration.html">Integration</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../metrics.html">Metrics</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../kubernetes.html">Kubernetes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../lineage.html">Lineage</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../changelog.html">Changelog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../faq.html">FAQ</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../macros.html">Macros reference</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../../index.html">API Reference</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../../index.html#operators">Operators</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../index.html#hooks">Hooks</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../index.html#executors">Executors</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../../../index.html#models">Models</a><ul class="current">
<li class="toctree-l3 current"><a class="reference internal" href="../index.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">airflow.models</span></code></a><ul class="current">
<li class="toctree-l4 current"><a class="reference internal" href="../index.html#submodules">Submodules</a></li>
<li class="toctree-l4"><a class="reference internal" href="../index.html#package-contents">Package Contents</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../../index.html#core-and-community-package">Core and community package</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../../../index.html">Airflow</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../../../index.html">Docs</a> &raquo;</li>
<li><a href="../../../index.html">API Reference</a> &raquo;</li>
<li><a href="../index.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">airflow.models</span></code></a> &raquo;</li>
<li><code class="xref py py-mod docutils literal notranslate"><span class="pre">airflow.models.dag</span></code></li>
<li class="wy-breadcrumbs-aside">
<a href="../../../../_sources/_api/airflow/models/dag/index.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="module-airflow.models.dag">
<span id="airflow-models-dag"></span><h1><a class="reference internal" href="#module-airflow.models.dag" title="airflow.models.dag"><code class="xref py py-mod docutils literal notranslate"><span class="pre">airflow.models.dag</span></code></a><a class="headerlink" href="#module-airflow.models.dag" title="Permalink to this headline"></a></h1>
<div class="section" id="module-contents">
<h2>Module Contents<a class="headerlink" href="#module-contents" title="Permalink to this headline"></a></h2>
<dl class="data">
<dt id="airflow.models.dag.ScheduleInterval">
<code class="sig-prename descclassname">airflow.models.dag.</code><code class="sig-name descname">ScheduleInterval</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#ScheduleInterval"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.ScheduleInterval" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="airflow.models.dag.get_last_dagrun">
<code class="sig-prename descclassname">airflow.models.dag.</code><code class="sig-name descname">get_last_dagrun</code><span class="sig-paren">(</span><em class="sig-param">dag_id</em>, <em class="sig-param">session</em>, <em class="sig-param">include_externally_triggered=False</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#get_last_dagrun"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.get_last_dagrun" title="Permalink to this definition"></a></dt>
<dt>
<code class="sig-name descname">Returns the last dag run for a dag, None if there was none.</code></dt>
<dt>
<code class="sig-name descname">Last dag run can be any type of run eg. scheduled or backfilled.</code></dt>
<dt>
<code class="sig-name descname">Overridden DagRuns are ignored.</code></dt>
<dd></dd></dl>
<dl class="class">
<dt id="airflow.models.dag.DAG">
<em class="property">class </em><code class="sig-prename descclassname">airflow.models.dag.</code><code class="sig-name descname">DAG</code><span class="sig-paren">(</span><em class="sig-param">dag_id</em>, <em class="sig-param">description=''</em>, <em class="sig-param">schedule_interval=timedelta(days=1)</em>, <em class="sig-param">start_date=None</em>, <em class="sig-param">end_date=None</em>, <em class="sig-param">full_filepath=None</em>, <em class="sig-param">template_searchpath=None</em>, <em class="sig-param">template_undefined=jinja2.Undefined</em>, <em class="sig-param">user_defined_macros=None</em>, <em class="sig-param">user_defined_filters=None</em>, <em class="sig-param">default_args=None</em>, <em class="sig-param">concurrency=configuration.conf.getint('core'</em>, <em class="sig-param">'dag_concurrency')</em>, <em class="sig-param">max_active_runs=configuration.conf.getint('core'</em>, <em class="sig-param">'max_active_runs_per_dag')</em>, <em class="sig-param">dagrun_timeout=None</em>, <em class="sig-param">sla_miss_callback=None</em>, <em class="sig-param">default_view=None</em>, <em class="sig-param">orientation=configuration.conf.get('webserver'</em>, <em class="sig-param">'dag_orientation')</em>, <em class="sig-param">catchup=configuration.conf.getboolean('scheduler'</em>, <em class="sig-param">'catchup_by_default')</em>, <em class="sig-param">on_success_callback=None</em>, <em class="sig-param">on_failure_callback=None</em>, <em class="sig-param">doc_md=None</em>, <em class="sig-param">params=None</em>, <em class="sig-param">access_control=None</em>, <em class="sig-param">is_paused_upon_creation=None</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">airflow.dag.base_dag.BaseDag</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">airflow.utils.log.logging_mixin.LoggingMixin</span></code></p>
<p>A dag (directed acyclic graph) is a collection of tasks with directional
dependencies. A dag also has a schedule, a start date and an end date
(optional). For each schedule, (say daily or hourly), the DAG needs to run
each individual tasks as their dependencies are met. Certain tasks have
the property of depending on their own past, meaning that they can’t run
until their previous schedule (and upstream tasks) are completed.</p>
<p>DAGs essentially act as namespaces for tasks. A task_id can only be
added once to a DAG.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>dag_id</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – The id of the DAG</p></li>
<li><p><strong>description</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – The description for the DAG to e.g. be shown on the webserver</p></li>
<li><p><strong>schedule_interval</strong> (<a class="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.timedelta" title="(in Python v3.7)"><em>datetime.timedelta</em></a><em> or
</em><em>dateutil.relativedelta.relativedelta</em><em> or </em><em>str that acts as a cron
expression</em>) – Defines how often that DAG runs, this
timedelta object gets added to your latest task instance’s
execution_date to figure out the next schedule</p></li>
<li><p><strong>start_date</strong> (<a class="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.datetime" title="(in Python v3.7)"><em>datetime.datetime</em></a>) – The timestamp from which the scheduler will
attempt to backfill</p></li>
<li><p><strong>end_date</strong> (<a class="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.datetime" title="(in Python v3.7)"><em>datetime.datetime</em></a>) – A date beyond which your DAG won’t run, leave to None
for open ended scheduling</p></li>
<li><p><strong>template_searchpath</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a><em> or </em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.7)"><em>list</em></a><em>[</em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a><em>]</em>) – This list of folders (non relative)
defines where jinja will look for your templates. Order matters.
Note that jinja/airflow includes the path of your DAG file by
default</p></li>
<li><p><strong>template_undefined</strong> (<em>jinja2.Undefined</em>) – Template undefined type.</p></li>
<li><p><strong>user_defined_macros</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) – a dictionary of macros that will be exposed
in your jinja templates. For example, passing <code class="docutils literal notranslate"><span class="pre">dict(foo='bar')</span></code>
to this argument allows you to <code class="docutils literal notranslate"><span class="pre">{{</span> <span class="pre">foo</span> <span class="pre">}}</span></code> in all jinja
templates related to this DAG. Note that you can pass any
type of object here.</p></li>
<li><p><strong>user_defined_filters</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) – a dictionary of filters that will be exposed
in your jinja templates. For example, passing
<code class="docutils literal notranslate"><span class="pre">dict(hello=lambda</span> <span class="pre">name:</span> <span class="pre">'Hello</span> <span class="pre">%s'</span> <span class="pre">%</span> <span class="pre">name)</span></code> to this argument allows
you to <code class="docutils literal notranslate"><span class="pre">{{</span> <span class="pre">'world'</span> <span class="pre">|</span> <span class="pre">hello</span> <span class="pre">}}</span></code> in all jinja templates related to
this DAG.</p></li>
<li><p><strong>default_args</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) – A dictionary of default parameters to be used
as constructor keyword parameters when initialising operators.
Note that operators have the same hook, and precede those defined
here, meaning that if your dict contains <cite>‘depends_on_past’: True</cite>
here and <cite>‘depends_on_past’: False</cite> in the operator’s call
<cite>default_args</cite>, the actual value will be <cite>False</cite>.</p></li>
<li><p><strong>params</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) – a dictionary of DAG level parameters that are made
accessible in templates, namespaced under <cite>params</cite>. These
params can be overridden at the task level.</p></li>
<li><p><strong>concurrency</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) – the number of task instances allowed to run
concurrently</p></li>
<li><p><strong>max_active_runs</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) – maximum number of active DAG runs, beyond this
number of DAG runs in a running state, the scheduler won’t create
new active DAG runs</p></li>
<li><p><strong>dagrun_timeout</strong> (<a class="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.timedelta" title="(in Python v3.7)"><em>datetime.timedelta</em></a>) – specify how long a DagRun should be up before
timing out / failing, so that new DagRuns can be created. The timeout
is only enforced for scheduled DagRuns, and only once the
# of active DagRuns == max_active_runs.</p></li>
<li><p><strong>sla_miss_callback</strong> (<em>types.FunctionType</em>) – specify a function to call when reporting SLA
timeouts.</p></li>
<li><p><strong>default_view</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Specify DAG default view (tree, graph, duration,
gantt, landing_times)</p></li>
<li><p><strong>orientation</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Specify DAG orientation in graph view (LR, TB, RL, BT)</p></li>
<li><p><strong>catchup</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Perform scheduler catchup (or only run latest)? Defaults to True</p></li>
<li><p><strong>on_failure_callback</strong> (<em>callable</em>) – A function to be called when a DagRun of this dag fails.
A context dictionary is passed as a single parameter to this function.</p></li>
<li><p><strong>on_success_callback</strong> (<em>callable</em>) – Much like the <code class="docutils literal notranslate"><span class="pre">on_failure_callback</span></code> except
that it is executed when the dag succeeds.</p></li>
<li><p><strong>access_control</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) – Specify optional DAG-level permissions, e.g.,
“{‘role1’: {‘can_dag_read’}, ‘role2’: {‘can_dag_read’, ‘can_dag_edit’}}”</p></li>
<li><p><strong>is_paused_upon_creation</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a><em> or </em><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.7)"><em>None</em></a>) – Specifies if the dag is paused when created for the first time.
If the dag exists already, this flag will be ignored. If this optional parameter
is not specified, the global config setting will be used.</p></li>
</ul>
</dd>
</dl>
<dl class="attribute">
<dt id="airflow.models.dag.DAG._comps">
<code class="sig-name descname">_comps</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG._comps"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG._comps" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DAG.dag_id">
<code class="sig-name descname">dag_id</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.dag_id"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.dag_id" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DAG.full_filepath">
<code class="sig-name descname">full_filepath</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.full_filepath"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.full_filepath" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DAG.concurrency">
<code class="sig-name descname">concurrency</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.concurrency"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.concurrency" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DAG.access_control">
<code class="sig-name descname">access_control</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.access_control"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.access_control" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DAG.description">
<code class="sig-name descname">description</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.description"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.description" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DAG.pickle_id">
<code class="sig-name descname">pickle_id</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.pickle_id"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.pickle_id" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DAG.tasks">
<code class="sig-name descname">tasks</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.tasks"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.tasks" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DAG.task_ids">
<code class="sig-name descname">task_ids</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.task_ids"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.task_ids" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DAG.filepath">
<code class="sig-name descname">filepath</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.filepath"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.filepath" title="Permalink to this definition"></a></dt>
<dd><p>File location of where the dag object is instantiated</p>
</dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DAG.folder">
<code class="sig-name descname">folder</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.folder"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.folder" title="Permalink to this definition"></a></dt>
<dd><p>Folder location of where the dag object is instantiated</p>
</dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DAG.owner">
<code class="sig-name descname">owner</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.owner"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.owner" title="Permalink to this definition"></a></dt>
<dd><p>Return list of all owners found in DAG tasks.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Comma separated list of owners in DAG tasks</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)">str</a></p>
</dd>
</dl>
</dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DAG.concurrency_reached">
<code class="sig-name descname">concurrency_reached</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.concurrency_reached"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.concurrency_reached" title="Permalink to this definition"></a></dt>
<dd><p>Returns a boolean indicating whether the concurrency limit for this DAG
has been reached</p>
</dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DAG.is_paused">
<code class="sig-name descname">is_paused</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.is_paused"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.is_paused" title="Permalink to this definition"></a></dt>
<dd><p>Returns a boolean indicating whether this DAG is paused</p>
</dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DAG.latest_execution_date">
<code class="sig-name descname">latest_execution_date</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.latest_execution_date"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.latest_execution_date" title="Permalink to this definition"></a></dt>
<dd><p>Returns the latest date for which at least one dag run exists</p>
</dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DAG.subdags">
<code class="sig-name descname">subdags</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.subdags"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.subdags" title="Permalink to this definition"></a></dt>
<dd><p>Returns a list of the subdag objects associated to this DAG</p>
</dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DAG.roots">
<code class="sig-name descname">roots</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.roots"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.roots" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.__repr__">
<code class="sig-name descname">__repr__</code><span class="sig-paren">(</span><em class="sig-param">self</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.__repr__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.__repr__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.__eq__">
<code class="sig-name descname">__eq__</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">other</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.__eq__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.__eq__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.__ne__">
<code class="sig-name descname">__ne__</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">other</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.__ne__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.__ne__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.__lt__">
<code class="sig-name descname">__lt__</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">other</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.__lt__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.__lt__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.__hash__">
<code class="sig-name descname">__hash__</code><span class="sig-paren">(</span><em class="sig-param">self</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.__hash__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.__hash__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.__enter__">
<code class="sig-name descname">__enter__</code><span class="sig-paren">(</span><em class="sig-param">self</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.__enter__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.__enter__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.__exit__">
<code class="sig-name descname">__exit__</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">_type</em>, <em class="sig-param">_value</em>, <em class="sig-param">_tb</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.__exit__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.__exit__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.get_default_view">
<code class="sig-name descname">get_default_view</code><span class="sig-paren">(</span><em class="sig-param">self</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.get_default_view"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.get_default_view" title="Permalink to this definition"></a></dt>
<dd><p>This is only there for backward compatible jinja2 templates</p>
</dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.date_range">
<code class="sig-name descname">date_range</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">start_date</em>, <em class="sig-param">num=None</em>, <em class="sig-param">end_date=timezone.utcnow()</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.date_range"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.date_range" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.is_fixed_time_schedule">
<code class="sig-name descname">is_fixed_time_schedule</code><span class="sig-paren">(</span><em class="sig-param">self</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.is_fixed_time_schedule"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.is_fixed_time_schedule" title="Permalink to this definition"></a></dt>
<dd><p>Figures out if the DAG schedule has a fixed time (e.g. 3 AM).</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>True if the schedule has a fixed time, False if not.</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.following_schedule">
<code class="sig-name descname">following_schedule</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">dttm</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.following_schedule"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.following_schedule" title="Permalink to this definition"></a></dt>
<dd><p>Calculates the following schedule for this dag in UTC.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>dttm</strong> – utc datetime</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>utc datetime</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.previous_schedule">
<code class="sig-name descname">previous_schedule</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">dttm</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.previous_schedule"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.previous_schedule" title="Permalink to this definition"></a></dt>
<dd><p>Calculates the previous schedule for this dag in UTC</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>dttm</strong> – utc datetime</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>utc datetime</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.get_run_dates">
<code class="sig-name descname">get_run_dates</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">start_date</em>, <em class="sig-param">end_date=None</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.get_run_dates"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.get_run_dates" title="Permalink to this definition"></a></dt>
<dd><p>Returns a list of dates between the interval received as parameter using this
dag’s schedule interval. Returned dates can be used for execution dates.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>start_date</strong> (<em>datetime</em>) – the start date of the interval</p></li>
<li><p><strong>end_date</strong> (<em>datetime</em>) – the end date of the interval, defaults to timezone.utcnow()</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>a list of dates within the interval following the dag’s schedule</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.7)">list</a></p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.normalize_schedule">
<code class="sig-name descname">normalize_schedule</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">dttm</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.normalize_schedule"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.normalize_schedule" title="Permalink to this definition"></a></dt>
<dd><p>Returns dttm + interval unless dttm is first interval then it returns dttm</p>
</dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.get_last_dagrun">
<code class="sig-name descname">get_last_dagrun</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">session=None</em>, <em class="sig-param">include_externally_triggered=False</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.get_last_dagrun"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.get_last_dagrun" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG._get_concurrency_reached">
<code class="sig-name descname">_get_concurrency_reached</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">session=None</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG._get_concurrency_reached"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG._get_concurrency_reached" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG._get_is_paused">
<code class="sig-name descname">_get_is_paused</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">session=None</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG._get_is_paused"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG._get_is_paused" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.handle_callback">
<code class="sig-name descname">handle_callback</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">dagrun</em>, <em class="sig-param">success=True</em>, <em class="sig-param">reason=None</em>, <em class="sig-param">session=None</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.handle_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.handle_callback" title="Permalink to this definition"></a></dt>
<dd><p>Triggers the appropriate callback depending on the value of success, namely the
on_failure_callback or on_success_callback. This method gets the context of a
single TaskInstance part of this DagRun and passes that to the callable along
with a ‘reason’, primarily to differentiate DagRun failures.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>dagrun</strong> – DagRun object</p></li>
<li><p><strong>success</strong> – Flag to specify if failure or success callback should be called</p></li>
<li><p><strong>reason</strong> – Completion reason</p></li>
<li><p><strong>session</strong> – Database session</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.get_active_runs">
<code class="sig-name descname">get_active_runs</code><span class="sig-paren">(</span><em class="sig-param">self</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.get_active_runs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.get_active_runs" title="Permalink to this definition"></a></dt>
<dd><p>Returns a list of dag run execution dates currently running</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>List of execution dates</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.get_num_active_runs">
<code class="sig-name descname">get_num_active_runs</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">external_trigger=None</em>, <em class="sig-param">session=None</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.get_num_active_runs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.get_num_active_runs" title="Permalink to this definition"></a></dt>
<dd><p>Returns the number of active “running” dag runs</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>external_trigger</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – True for externally triggered active dag runs</p></li>
<li><p><strong>session</strong></p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>number greater than 0 for active dag runs</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.get_dagrun">
<code class="sig-name descname">get_dagrun</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">execution_date</em>, <em class="sig-param">session=None</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.get_dagrun"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.get_dagrun" title="Permalink to this definition"></a></dt>
<dd><p>Returns the dag run for a given execution date if it exists, otherwise
none.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>execution_date</strong> – The execution date of the DagRun to find.</p></li>
<li><p><strong>session</strong></p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The DagRun if found, otherwise None.</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG._get_latest_execution_date">
<code class="sig-name descname">_get_latest_execution_date</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">session=None</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG._get_latest_execution_date"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG._get_latest_execution_date" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.resolve_template_files">
<code class="sig-name descname">resolve_template_files</code><span class="sig-paren">(</span><em class="sig-param">self</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.resolve_template_files"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.resolve_template_files" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.get_template_env">
<code class="sig-name descname">get_template_env</code><span class="sig-paren">(</span><em class="sig-param">self</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.get_template_env"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.get_template_env" title="Permalink to this definition"></a></dt>
<dd><p>Returns a jinja2 Environment while taking into account the DAGs
template_searchpath, user_defined_macros and user_defined_filters</p>
</dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.set_dependency">
<code class="sig-name descname">set_dependency</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">upstream_task_id</em>, <em class="sig-param">downstream_task_id</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.set_dependency"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.set_dependency" title="Permalink to this definition"></a></dt>
<dd><p>Simple utility method to set dependency between two tasks that
already have been added to the DAG using add_task()</p>
</dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.get_task_instances">
<code class="sig-name descname">get_task_instances</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">start_date=None</em>, <em class="sig-param">end_date=None</em>, <em class="sig-param">state=None</em>, <em class="sig-param">session=None</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.get_task_instances"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.get_task_instances" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.topological_sort">
<code class="sig-name descname">topological_sort</code><span class="sig-paren">(</span><em class="sig-param">self</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.topological_sort"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.topological_sort" title="Permalink to this definition"></a></dt>
<dd><p>Sorts tasks in topographical order, such that a task comes after any of its
upstream dependencies.</p>
<p>Heavily inspired by:
<a class="reference external" href="http://blog.jupo.org/2012/04/06/topological-sorting-acyclic-directed-graphs/">http://blog.jupo.org/2012/04/06/topological-sorting-acyclic-directed-graphs/</a></p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>list of tasks in topological order</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.set_dag_runs_state">
<code class="sig-name descname">set_dag_runs_state</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">state=State.RUNNING</em>, <em class="sig-param">session=None</em>, <em class="sig-param">start_date=None</em>, <em class="sig-param">end_date=None</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.set_dag_runs_state"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.set_dag_runs_state" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.clear">
<code class="sig-name descname">clear</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">start_date=None</em>, <em class="sig-param">end_date=None</em>, <em class="sig-param">only_failed=False</em>, <em class="sig-param">only_running=False</em>, <em class="sig-param">confirm_prompt=False</em>, <em class="sig-param">include_subdags=True</em>, <em class="sig-param">include_parentdag=True</em>, <em class="sig-param">reset_dag_runs=True</em>, <em class="sig-param">dry_run=False</em>, <em class="sig-param">session=None</em>, <em class="sig-param">get_tis=False</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.clear"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.clear" title="Permalink to this definition"></a></dt>
<dd><p>Clears a set of task instances associated with the current dag for
a specified date range.</p>
</dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.clear_dags">
<em class="property">classmethod </em><code class="sig-name descname">clear_dags</code><span class="sig-paren">(</span><em class="sig-param">cls</em>, <em class="sig-param">dags</em>, <em class="sig-param">start_date=None</em>, <em class="sig-param">end_date=None</em>, <em class="sig-param">only_failed=False</em>, <em class="sig-param">only_running=False</em>, <em class="sig-param">confirm_prompt=False</em>, <em class="sig-param">include_subdags=True</em>, <em class="sig-param">include_parentdag=False</em>, <em class="sig-param">reset_dag_runs=True</em>, <em class="sig-param">dry_run=False</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.clear_dags"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.clear_dags" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.__deepcopy__">
<code class="sig-name descname">__deepcopy__</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">memo</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.__deepcopy__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.__deepcopy__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.sub_dag">
<code class="sig-name descname">sub_dag</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">task_regex</em>, <em class="sig-param">include_downstream=False</em>, <em class="sig-param">include_upstream=True</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.sub_dag"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.sub_dag" title="Permalink to this definition"></a></dt>
<dd><p>Returns a subset of the current dag as a deep copy of the current dag
based on a regex that should match one or many tasks, and includes
upstream and downstream neighbours based on the flag passed.</p>
</dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.has_task">
<code class="sig-name descname">has_task</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">task_id</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.has_task"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.has_task" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.get_task">
<code class="sig-name descname">get_task</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">task_id</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.get_task"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.get_task" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.pickle_info">
<code class="sig-name descname">pickle_info</code><span class="sig-paren">(</span><em class="sig-param">self</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.pickle_info"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.pickle_info" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.pickle">
<code class="sig-name descname">pickle</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">session=None</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.pickle"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.pickle" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.tree_view">
<code class="sig-name descname">tree_view</code><span class="sig-paren">(</span><em class="sig-param">self</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.tree_view"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.tree_view" title="Permalink to this definition"></a></dt>
<dd><p>Shows an ascii tree representation of the DAG</p>
</dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.add_task">
<code class="sig-name descname">add_task</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">task</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.add_task"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.add_task" title="Permalink to this definition"></a></dt>
<dd><p>Add a task to the DAG</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>task</strong> (<em>task</em>) – the task you want to add</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.add_tasks">
<code class="sig-name descname">add_tasks</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">tasks</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.add_tasks"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.add_tasks" title="Permalink to this definition"></a></dt>
<dd><p>Add a list of tasks to the DAG</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>tasks</strong> (<em>list of tasks</em>) – a lit of tasks you want to add</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.run">
<code class="sig-name descname">run</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">start_date=None</em>, <em class="sig-param">end_date=None</em>, <em class="sig-param">mark_success=False</em>, <em class="sig-param">local=False</em>, <em class="sig-param">executor=None</em>, <em class="sig-param">donot_pickle=configuration.conf.getboolean('core'</em>, <em class="sig-param">'donot_pickle')</em>, <em class="sig-param">ignore_task_deps=False</em>, <em class="sig-param">ignore_first_depends_on_past=False</em>, <em class="sig-param">pool=None</em>, <em class="sig-param">delay_on_limit_secs=1.0</em>, <em class="sig-param">verbose=False</em>, <em class="sig-param">conf=None</em>, <em class="sig-param">rerun_failed_tasks=False</em>, <em class="sig-param">run_backwards=False</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.run"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.run" title="Permalink to this definition"></a></dt>
<dd><p>Runs the DAG.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>start_date</strong> (<a class="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.datetime" title="(in Python v3.7)"><em>datetime.datetime</em></a>) – the start date of the range to run</p></li>
<li><p><strong>end_date</strong> (<a class="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.datetime" title="(in Python v3.7)"><em>datetime.datetime</em></a>) – the end date of the range to run</p></li>
<li><p><strong>mark_success</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – True to mark jobs as succeeded without running them</p></li>
<li><p><strong>local</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – True to run the tasks using the LocalExecutor</p></li>
<li><p><strong>executor</strong> (<em>airflow.executor.BaseExecutor</em>) – The executor instance to run the tasks</p></li>
<li><p><strong>donot_pickle</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – True to avoid pickling DAG object and send to workers</p></li>
<li><p><strong>ignore_task_deps</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – True to skip upstream tasks</p></li>
<li><p><strong>ignore_first_depends_on_past</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – True to ignore depends_on_past
dependencies for the first set of tasks only</p></li>
<li><p><strong>pool</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – Resource pool to use</p></li>
<li><p><strong>delay_on_limit_secs</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.7)"><em>float</em></a>) – Time in seconds to wait before next attempt to run
dag run when max_active_runs limit has been reached</p></li>
<li><p><strong>verbose</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Make logging output more verbose</p></li>
<li><p><strong>conf</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) – user defined dictionary passed from CLI</p></li>
<li><p><strong>rerun_failed_tasks</strong></p></li>
<li><p><strong>run_backwards</strong></p></li>
</ul>
</dd>
<dt class="field-even">Type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)">bool</a></p>
</dd>
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)">bool</a></p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.cli">
<code class="sig-name descname">cli</code><span class="sig-paren">(</span><em class="sig-param">self</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.cli"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.cli" title="Permalink to this definition"></a></dt>
<dd><p>Exposes a CLI specific to this DAG</p>
</dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.create_dagrun">
<code class="sig-name descname">create_dagrun</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">run_id</em>, <em class="sig-param">state</em>, <em class="sig-param">execution_date=None</em>, <em class="sig-param">start_date=None</em>, <em class="sig-param">external_trigger=False</em>, <em class="sig-param">conf=None</em>, <em class="sig-param">session=None</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.create_dagrun"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.create_dagrun" title="Permalink to this definition"></a></dt>
<dd><p>Creates a dag run from this dag including the tasks associated with this dag.
Returns the dag run.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>run_id</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – defines the the run id for this dag run</p></li>
<li><p><strong>execution_date</strong> (<a class="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.datetime" title="(in Python v3.7)"><em>datetime.datetime</em></a>) – the execution date of this dag run</p></li>
<li><p><strong>state</strong> (<em>airflow.utils.state.State</em>) – the state of the dag run</p></li>
<li><p><strong>start_date</strong> (<em>datetime</em>) – the date this dag run should be evaluated</p></li>
<li><p><strong>external_trigger</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – whether this dag run is externally triggered</p></li>
<li><p><strong>session</strong> (<a class="reference external" href="https://docs.sqlalchemy.org/en/13/orm/session_api.html#sqlalchemy.orm.session.Session" title="(in SQLAlchemy v1.3)"><em>sqlalchemy.orm.session.Session</em></a>) – database session</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.sync_to_db">
<code class="sig-name descname">sync_to_db</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">owner=None</em>, <em class="sig-param">sync_time=None</em>, <em class="sig-param">session=None</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.sync_to_db"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.sync_to_db" title="Permalink to this definition"></a></dt>
<dd><p>Save attributes about this DAG to the DB. Note that this method
can be called for both DAGs and SubDAGs. A SubDag is actually a
SubDagOperator.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>dag</strong> (<a class="reference internal" href="../index.html#airflow.models.DAG" title="airflow.models.DAG"><em>airflow.models.DAG</em></a>) – the DAG object to save to the DB</p></li>
<li><p><strong>sync_time</strong> (<em>datetime</em>) – The time that the DAG should be marked as sync’ed</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>None</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.deactivate_unknown_dags">
<em class="property">static </em><code class="sig-name descname">deactivate_unknown_dags</code><span class="sig-paren">(</span><em class="sig-param">active_dag_ids</em>, <em class="sig-param">session=None</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.deactivate_unknown_dags"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.deactivate_unknown_dags" title="Permalink to this definition"></a></dt>
<dd><p>Given a list of known DAGs, deactivate any other DAGs that are
marked as active in the ORM</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>active_dag_ids</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.7)"><em>list</em></a><em>[</em><em>unicode</em><em>]</em>) – list of DAG IDs that are active</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>None</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.deactivate_stale_dags">
<em class="property">static </em><code class="sig-name descname">deactivate_stale_dags</code><span class="sig-paren">(</span><em class="sig-param">expiration_date</em>, <em class="sig-param">session=None</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.deactivate_stale_dags"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.deactivate_stale_dags" title="Permalink to this definition"></a></dt>
<dd><p>Deactivate any DAGs that were last touched by the scheduler before
the expiration date. These DAGs were likely deleted.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>expiration_date</strong> (<em>datetime</em>) – set inactive DAGs that were touched before this
time</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>None</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.get_num_task_instances">
<em class="property">static </em><code class="sig-name descname">get_num_task_instances</code><span class="sig-paren">(</span><em class="sig-param">dag_id</em>, <em class="sig-param">task_ids=None</em>, <em class="sig-param">states=None</em>, <em class="sig-param">session=None</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.get_num_task_instances"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.get_num_task_instances" title="Permalink to this definition"></a></dt>
<dd><p>Returns the number of task instances in the given DAG.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>session</strong> – ORM session</p></li>
<li><p><strong>dag_id</strong> (<em>unicode</em>) – ID of the DAG to get the task concurrency of</p></li>
<li><p><strong>task_ids</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.7)"><em>list</em></a><em>[</em><em>unicode</em><em>]</em>) – A list of valid task IDs for the given DAG</p></li>
<li><p><strong>states</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.7)"><em>list</em></a><em>[</em><em>state</em><em>]</em>) – A list of states to filter by if supplied</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The number of running tasks</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)">int</a></p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG.test_cycle">
<code class="sig-name descname">test_cycle</code><span class="sig-paren">(</span><em class="sig-param">self</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG.test_cycle"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG.test_cycle" title="Permalink to this definition"></a></dt>
<dd><p>Check to see if there are any cycles in the DAG. Returns False if no cycle found,
otherwise raises exception.</p>
</dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DAG._test_cycle_helper">
<code class="sig-name descname">_test_cycle_helper</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">visit_map</em>, <em class="sig-param">task_id</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DAG._test_cycle_helper"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DAG._test_cycle_helper" title="Permalink to this definition"></a></dt>
<dd><p>Checks if a cycle exists from the input task using DFS traversal</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="airflow.models.dag.DagModel">
<em class="property">class </em><code class="sig-prename descclassname">airflow.models.dag.</code><code class="sig-name descname">DagModel</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DagModel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DagModel" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="../base/index.html#airflow.models.base.Base" title="airflow.models.base.Base"><code class="xref py py-class docutils literal notranslate"><span class="pre">airflow.models.base.Base</span></code></a></p>
<dl class="attribute">
<dt id="airflow.models.dag.DagModel.__tablename__">
<code class="sig-name descname">__tablename__</code><em class="property"> = dag</em><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DagModel.__tablename__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DagModel.__tablename__" title="Permalink to this definition"></a></dt>
<dd><p>These items are stored in the database for state related information</p>
</dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DagModel.dag_id">
<code class="sig-name descname">dag_id</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DagModel.dag_id"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DagModel.dag_id" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DagModel.is_paused_at_creation">
<code class="sig-name descname">is_paused_at_creation</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DagModel.is_paused_at_creation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DagModel.is_paused_at_creation" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DagModel.is_paused">
<code class="sig-name descname">is_paused</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DagModel.is_paused"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DagModel.is_paused" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DagModel.is_subdag">
<code class="sig-name descname">is_subdag</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DagModel.is_subdag"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DagModel.is_subdag" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DagModel.is_active">
<code class="sig-name descname">is_active</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DagModel.is_active"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DagModel.is_active" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DagModel.last_scheduler_run">
<code class="sig-name descname">last_scheduler_run</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DagModel.last_scheduler_run"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DagModel.last_scheduler_run" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DagModel.last_pickled">
<code class="sig-name descname">last_pickled</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DagModel.last_pickled"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DagModel.last_pickled" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DagModel.last_expired">
<code class="sig-name descname">last_expired</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DagModel.last_expired"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DagModel.last_expired" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DagModel.scheduler_lock">
<code class="sig-name descname">scheduler_lock</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DagModel.scheduler_lock"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DagModel.scheduler_lock" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DagModel.pickle_id">
<code class="sig-name descname">pickle_id</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DagModel.pickle_id"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DagModel.pickle_id" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DagModel.fileloc">
<code class="sig-name descname">fileloc</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DagModel.fileloc"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DagModel.fileloc" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DagModel.owners">
<code class="sig-name descname">owners</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DagModel.owners"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DagModel.owners" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DagModel.description">
<code class="sig-name descname">description</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DagModel.description"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DagModel.description" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DagModel.default_view">
<code class="sig-name descname">default_view</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DagModel.default_view"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DagModel.default_view" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DagModel.schedule_interval">
<code class="sig-name descname">schedule_interval</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DagModel.schedule_interval"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DagModel.schedule_interval" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DagModel.timezone">
<code class="sig-name descname">timezone</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DagModel.timezone"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DagModel.timezone" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="airflow.models.dag.DagModel.safe_dag_id">
<code class="sig-name descname">safe_dag_id</code><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DagModel.safe_dag_id"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DagModel.safe_dag_id" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DagModel.__repr__">
<code class="sig-name descname">__repr__</code><span class="sig-paren">(</span><em class="sig-param">self</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DagModel.__repr__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DagModel.__repr__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DagModel.get_dagmodel">
<em class="property">static </em><code class="sig-name descname">get_dagmodel</code><span class="sig-paren">(</span><em class="sig-param">dag_id</em>, <em class="sig-param">session=None</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DagModel.get_dagmodel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DagModel.get_dagmodel" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DagModel.get_current">
<em class="property">classmethod </em><code class="sig-name descname">get_current</code><span class="sig-paren">(</span><em class="sig-param">cls</em>, <em class="sig-param">dag_id</em>, <em class="sig-param">session=None</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DagModel.get_current"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DagModel.get_current" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DagModel.get_default_view">
<code class="sig-name descname">get_default_view</code><span class="sig-paren">(</span><em class="sig-param">self</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DagModel.get_default_view"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DagModel.get_default_view" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DagModel.get_last_dagrun">
<code class="sig-name descname">get_last_dagrun</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">session=None</em>, <em class="sig-param">include_externally_triggered=False</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DagModel.get_last_dagrun"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DagModel.get_last_dagrun" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DagModel.get_dag">
<code class="sig-name descname">get_dag</code><span class="sig-paren">(</span><em class="sig-param">self</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DagModel.get_dag"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DagModel.get_dag" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DagModel.create_dagrun">
<code class="sig-name descname">create_dagrun</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">run_id</em>, <em class="sig-param">state</em>, <em class="sig-param">execution_date</em>, <em class="sig-param">start_date=None</em>, <em class="sig-param">external_trigger=False</em>, <em class="sig-param">conf=None</em>, <em class="sig-param">session=None</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DagModel.create_dagrun"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DagModel.create_dagrun" title="Permalink to this definition"></a></dt>
<dd><p>Creates a dag run from this dag including the tasks associated with this dag.
Returns the dag run.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>run_id</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – defines the the run id for this dag run</p></li>
<li><p><strong>execution_date</strong> (<a class="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.datetime" title="(in Python v3.7)"><em>datetime.datetime</em></a>) – the execution date of this dag run</p></li>
<li><p><strong>state</strong> (<em>airflow.utils.state.State</em>) – the state of the dag run</p></li>
<li><p><strong>start_date</strong> (<a class="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.datetime" title="(in Python v3.7)"><em>datetime.datetime</em></a>) – the date this dag run should be evaluated</p></li>
<li><p><strong>external_trigger</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – whether this dag run is externally triggered</p></li>
<li><p><strong>session</strong> (<a class="reference external" href="https://docs.sqlalchemy.org/en/13/orm/session_api.html#sqlalchemy.orm.session.Session" title="(in SQLAlchemy v1.3)"><em>sqlalchemy.orm.session.Session</em></a>) – database session</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.models.dag.DagModel.set_is_paused">
<code class="sig-name descname">set_is_paused</code><span class="sig-paren">(</span><em class="sig-param">self</em>, <em class="sig-param">is_paused</em>, <em class="sig-param">including_subdags=True</em>, <em class="sig-param">session=None</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../_modules/airflow/models/dag.html#DagModel.set_is_paused"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.models.dag.DagModel.set_is_paused" title="Permalink to this definition"></a></dt>
<dd><p>Pause/Un-pause a DAG.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>is_paused</strong> – Is the DAG paused</p></li>
<li><p><strong>including_subdags</strong> – whether to include the DAG’s subdags</p></li>
<li><p><strong>session</strong> – session</p></li>
</ul>
</dd>
</dl>
</dd></dl>
</dd></dl>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../dagbag/index.html" class="btn btn-neutral float-right" title="airflow.models.dagbag" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="../crypto/index.html" class="btn btn-neutral float-left" title="airflow.models.crypto" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>