airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From criccom...@apache.org
Subject [25/35] incubator-airflow-site git commit: 1.9.0
Date Wed, 03 Jan 2018 17:48:25 GMT
http://git-wip-us.apache.org/repos/asf/incubator-airflow-site/blob/28a3eb60/_modules/airflow/contrib/operators/mlengine_operator.html
----------------------------------------------------------------------
diff --git a/_modules/airflow/contrib/operators/mlengine_operator.html b/_modules/airflow/contrib/operators/mlengine_operator.html
new file mode 100644
index 0000000..b322476
--- /dev/null
+++ b/_modules/airflow/contrib/operators/mlengine_operator.html
@@ -0,0 +1,795 @@
+
+
+<!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.contrib.operators.mlengine_operator &mdash; Airflow Documentation</title>
+  
+
+  
+  
+  
+  
+
+  
+
+  
+  
+    
+
+  
+
+  
+  
+    <link rel="stylesheet" href="../../../../_static/css/theme.css" type="text/css" />
+  
+
+  
+
+  
+        <link rel="index" title="Index"
+              href="../../../../genindex.html"/>
+        <link rel="search" title="Search" href="../../../../search.html"/>
+    <link rel="top" title="Airflow Documentation" href="../../../../index.html"/>
+        <link rel="up" title="Module code" href="../../../index.html"/> 
+
+  
+  <script src="../../../../_static/js/modernizr.min.js"></script>
+
+</head>
+
+<body class="wy-body-for-nav" role="document">
+
+   
+  <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 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>
+<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="../../../../configuration.html">Configuration</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="../../../../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="../../../../faq.html">FAQ</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../../../code.html">API Reference</a></li>
+</ul>
+
+            
+          
+        </div>
+      </div>
+    </nav>
+
+    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
+
+      
+      <nav class="wy-nav-top" role="navigation" 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">Module code</a> &raquo;</li>
+        
+      <li>airflow.contrib.operators.mlengine_operator</li>
+    
+    
+      <li class="wy-breadcrumbs-aside">
+        
+            
+        
+      </li>
+    
+  </ul>
+
+  
+  <hr/>
+</div>
+          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
+           <div itemprop="articleBody">
+            
+  <h1>Source code for airflow.contrib.operators.mlengine_operator</h1><div class="highlight"><pre>
+<span></span><span class="c1">#</span>
+<span class="c1"># Licensed to the Apache Software Foundation (ASF) under one or more</span>
+<span class="c1"># contributor license agreements.  See the NOTICE file distributed with</span>
+<span class="c1"># this work for additional information regarding copyright ownership.</span>
+<span class="c1"># The ASF licenses this file to You under the Apache License, Version 2.0</span>
+<span class="c1"># (the &#39;License&#39;); you may not use this file except in compliance with</span>
+<span class="c1"># the License.  You may obtain a copy of the License at</span>
+<span class="c1">#</span>
+<span class="c1">#    http://www.apache.org/licenses/LICENSE-2.0</span>
+<span class="c1">#</span>
+<span class="c1"># Unless required by applicable law or agreed to in writing, software</span>
+<span class="c1"># distributed under the License is distributed on an &#39;AS IS&#39; BASIS,</span>
+<span class="c1"># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
+<span class="c1"># See the License for the specific language governing permissions and</span>
+<span class="c1"># limitations under the License.</span>
+<span class="kn">import</span> <span class="nn">re</span>
+
+<span class="kn">from</span> <span class="nn">airflow</span> <span class="k">import</span> <span class="n">settings</span>
+<span class="kn">from</span> <span class="nn">airflow.contrib.hooks.gcp_mlengine_hook</span> <span class="k">import</span> <span class="n">MLEngineHook</span>
+<span class="kn">from</span> <span class="nn">airflow.exceptions</span> <span class="k">import</span> <span class="n">AirflowException</span>
+<span class="kn">from</span> <span class="nn">airflow.operators</span> <span class="k">import</span> <span class="n">BaseOperator</span>
+<span class="kn">from</span> <span class="nn">airflow.utils.decorators</span> <span class="k">import</span> <span class="n">apply_defaults</span>
+<span class="kn">from</span> <span class="nn">apiclient</span> <span class="k">import</span> <span class="n">errors</span>
+
+<span class="kn">from</span> <span class="nn">airflow.utils.log.logging_mixin</span> <span class="k">import</span> <span class="n">LoggingMixin</span>
+
+<span class="n">log</span> <span class="o">=</span> <span class="n">LoggingMixin</span><span class="p">()</span><span class="o">.</span><span class="n">log</span>
+
+
+<span class="k">def</span> <span class="nf">_create_prediction_input</span><span class="p">(</span><span class="n">project_id</span><span class="p">,</span>
+                             <span class="n">region</span><span class="p">,</span>
+                             <span class="n">data_format</span><span class="p">,</span>
+                             <span class="n">input_paths</span><span class="p">,</span>
+                             <span class="n">output_path</span><span class="p">,</span>
+                             <span class="n">model_name</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
+                             <span class="n">version_name</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
+                             <span class="n">uri</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
+                             <span class="n">max_worker_count</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
+                             <span class="n">runtime_version</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Create the batch prediction input from the given parameters.</span>
+
+<span class="sd">    Args:</span>
+<span class="sd">        A subset of arguments documented in __init__ method of class</span>
+<span class="sd">        MLEngineBatchPredictionOperator</span>
+
+<span class="sd">    Returns:</span>
+<span class="sd">        A dictionary representing the predictionInput object as documented</span>
+<span class="sd">        in https://cloud.google.com/ml-engine/reference/rest/v1/projects.jobs.</span>
+
+<span class="sd">    Raises:</span>
+<span class="sd">        ValueError: if a unique model/version origin cannot be determined.</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="n">prediction_input</span> <span class="o">=</span> <span class="p">{</span>
+        <span class="s1">&#39;dataFormat&#39;</span><span class="p">:</span> <span class="n">data_format</span><span class="p">,</span>
+        <span class="s1">&#39;inputPaths&#39;</span><span class="p">:</span> <span class="n">input_paths</span><span class="p">,</span>
+        <span class="s1">&#39;outputPath&#39;</span><span class="p">:</span> <span class="n">output_path</span><span class="p">,</span>
+        <span class="s1">&#39;region&#39;</span><span class="p">:</span> <span class="n">region</span>
+    <span class="p">}</span>
+
+    <span class="k">if</span> <span class="n">uri</span><span class="p">:</span>
+        <span class="k">if</span> <span class="n">model_name</span> <span class="ow">or</span> <span class="n">version_name</span><span class="p">:</span>
+            <span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span>
+                <span class="s1">&#39;Ambiguous model origin: Both uri and model/version name are provided.&#39;</span>
+            <span class="p">)</span>
+            <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s1">&#39;Ambiguous model origin.&#39;</span><span class="p">)</span>
+        <span class="n">prediction_input</span><span class="p">[</span><span class="s1">&#39;uri&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">uri</span>
+    <span class="k">elif</span> <span class="n">model_name</span><span class="p">:</span>
+        <span class="n">origin_name</span> <span class="o">=</span> <span class="s1">&#39;projects/</span><span class="si">{}</span><span class="s1">/models/</span><span class="si">{}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">project_id</span><span class="p">,</span> <span class="n">model_name</span><span class="p">)</span>
+        <span class="k">if</span> <span class="ow">not</span> <span class="n">version_name</span><span class="p">:</span>
+            <span class="n">prediction_input</span><span class="p">[</span><span class="s1">&#39;modelName&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">origin_name</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="n">prediction_input</span><span class="p">[</span><span class="s1">&#39;versionName&#39;</span><span class="p">]</span> <span class="o">=</span> \
+                <span class="n">origin_name</span> <span class="o">+</span> <span class="s1">&#39;/versions/</span><span class="si">{}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">version_name</span><span class="p">)</span>
+    <span class="k">else</span><span class="p">:</span>
+        <span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span>
+            <span class="s1">&#39;Missing model origin: Batch prediction expects a model, &#39;</span>
+            <span class="s1">&#39;a model &amp; version combination, or a URI to savedModel.&#39;</span><span class="p">)</span>
+        <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s1">&#39;Missing model origin.&#39;</span><span class="p">)</span>
+
+    <span class="k">if</span> <span class="n">max_worker_count</span><span class="p">:</span>
+        <span class="n">prediction_input</span><span class="p">[</span><span class="s1">&#39;maxWorkerCount&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">max_worker_count</span>
+    <span class="k">if</span> <span class="n">runtime_version</span><span class="p">:</span>
+        <span class="n">prediction_input</span><span class="p">[</span><span class="s1">&#39;runtimeVersion&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">runtime_version</span>
+
+    <span class="k">return</span> <span class="n">prediction_input</span>
+
+
+<span class="k">def</span> <span class="nf">_normalize_mlengine_job_id</span><span class="p">(</span><span class="n">job_id</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Replaces invalid MLEngine job_id characters with &#39;_&#39;.</span>
+
+<span class="sd">    This also adds a leading &#39;z&#39; in case job_id starts with an invalid</span>
+<span class="sd">    character.</span>
+
+<span class="sd">    Args:</span>
+<span class="sd">        job_id: A job_id str that may have invalid characters.</span>
+
+<span class="sd">    Returns:</span>
+<span class="sd">        A valid job_id representation.</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="n">match</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="sa">r</span><span class="s1">&#39;\d&#39;</span><span class="p">,</span> <span class="n">job_id</span><span class="p">)</span>
+    <span class="k">if</span> <span class="n">match</span> <span class="ow">and</span> <span class="n">match</span><span class="o">.</span><span class="n">start</span><span class="p">()</span> <span class="ow">is</span> <span class="mi">0</span><span class="p">:</span>
+        <span class="n">job_id</span> <span class="o">=</span> <span class="s1">&#39;z_</span><span class="si">{}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">job_id</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="s1">&#39;[^0-9a-zA-Z]+&#39;</span><span class="p">,</span> <span class="s1">&#39;_&#39;</span><span class="p">,</span> <span class="n">job_id</span><span class="p">)</span>
+
+
+<div class="viewcode-block" id="MLEngineBatchPredictionOperator"><a class="viewcode-back" href="../../../../integration.html#airflow.contrib.operators.mlengine_operator.MLEngineBatchPredictionOperator">[docs]</a><span class="k">class</span> <span class="nc">MLEngineBatchPredictionOperator</span><span class="p">(</span><span class="n">BaseOperator</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Start a Google Cloud ML Engine prediction job.</span>
+
+<span class="sd">    NOTE: For model origin, users should consider exactly one from the</span>
+<span class="sd">    three options below:</span>
+<span class="sd">    1. Populate &#39;uri&#39; field only, which should be a GCS location that</span>
+<span class="sd">    points to a tensorflow savedModel directory.</span>
+<span class="sd">    2. Populate &#39;model_name&#39; field only, which refers to an existing</span>
+<span class="sd">    model, and the default version of the model will be used.</span>
+<span class="sd">    3. Populate both &#39;model_name&#39; and &#39;version_name&#39; fields, which</span>
+<span class="sd">    refers to a specific version of a specific model.</span>
+
+<span class="sd">    In options 2 and 3, both model and version name should contain the</span>
+<span class="sd">    minimal identifier. For instance, call</span>
+<span class="sd">        MLEngineBatchPredictionOperator(</span>
+<span class="sd">            ...,</span>
+<span class="sd">            model_name=&#39;my_model&#39;,</span>
+<span class="sd">            version_name=&#39;my_version&#39;,</span>
+<span class="sd">            ...)</span>
+<span class="sd">    if the desired model version is</span>
+<span class="sd">    &quot;projects/my_project/models/my_model/versions/my_version&quot;.</span>
+
+
+<span class="sd">    :param project_id: The Google Cloud project name where the</span>
+<span class="sd">        prediction job is submitted.</span>
+<span class="sd">    :type project_id: string</span>
+
+<span class="sd">    :param job_id: A unique id for the prediction job on Google Cloud</span>
+<span class="sd">        ML Engine.</span>
+<span class="sd">    :type job_id: string</span>
+
+<span class="sd">    :param data_format: The format of the input data.</span>
+<span class="sd">        It will default to &#39;DATA_FORMAT_UNSPECIFIED&#39; if is not provided</span>
+<span class="sd">        or is not one of [&quot;TEXT&quot;, &quot;TF_RECORD&quot;, &quot;TF_RECORD_GZIP&quot;].</span>
+<span class="sd">    :type data_format: string</span>
+
+<span class="sd">    :param input_paths: A list of GCS paths of input data for batch</span>
+<span class="sd">        prediction. Accepting wildcard operator *, but only at the end.</span>
+<span class="sd">    :type input_paths: list of string</span>
+
+<span class="sd">    :param output_path: The GCS path where the prediction results are</span>
+<span class="sd">        written to.</span>
+<span class="sd">    :type output_path: string</span>
+
+<span class="sd">    :param region: The Google Compute Engine region to run the</span>
+<span class="sd">        prediction job in.:</span>
+<span class="sd">    :type region: string</span>
+
+<span class="sd">    :param model_name: The Google Cloud ML Engine model to use for prediction.</span>
+<span class="sd">        If version_name is not provided, the default version of this</span>
+<span class="sd">        model will be used.</span>
+<span class="sd">        Should not be None if version_name is provided.</span>
+<span class="sd">        Should be None if uri is provided.</span>
+<span class="sd">    :type model_name: string</span>
+
+<span class="sd">    :param version_name: The Google Cloud ML Engine model version to use for</span>
+<span class="sd">        prediction.</span>
+<span class="sd">        Should be None if uri is provided.</span>
+<span class="sd">    :type version_name: string</span>
+
+<span class="sd">    :param uri: The GCS path of the saved model to use for prediction.</span>
+<span class="sd">        Should be None if model_name is provided.</span>
+<span class="sd">        It should be a GCS path pointing to a tensorflow SavedModel.</span>
+<span class="sd">    :type uri: string</span>
+
+<span class="sd">    :param max_worker_count: The maximum number of workers to be used</span>
+<span class="sd">        for parallel processing. Defaults to 10 if not specified.</span>
+<span class="sd">    :type max_worker_count: int</span>
+
+<span class="sd">    :param runtime_version: The Google Cloud ML Engine runtime version to use</span>
+<span class="sd">        for batch prediction.</span>
+<span class="sd">    :type runtime_version: string</span>
+
+<span class="sd">    :param gcp_conn_id: The connection ID used for connection to Google</span>
+<span class="sd">        Cloud Platform.</span>
+<span class="sd">    :type gcp_conn_id: string</span>
+
+<span class="sd">    :param delegate_to: The account to impersonate, if any.</span>
+<span class="sd">        For this to work, the service account making the request must</span>
+<span class="sd">        have doamin-wide delegation enabled.</span>
+<span class="sd">    :type delegate_to: string</span>
+
+<span class="sd">    Raises:</span>
+<span class="sd">        ValueError: if a unique model/version origin cannot be determined.</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+
+    <span class="n">template_fields</span> <span class="o">=</span> <span class="p">[</span>
+        <span class="s2">&quot;prediction_job_request&quot;</span><span class="p">,</span>
+    <span class="p">]</span>
+
+    <span class="nd">@apply_defaults</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
+                 <span class="n">project_id</span><span class="p">,</span>
+                 <span class="n">job_id</span><span class="p">,</span>
+                 <span class="n">region</span><span class="p">,</span>
+                 <span class="n">data_format</span><span class="p">,</span>
+                 <span class="n">input_paths</span><span class="p">,</span>
+                 <span class="n">output_path</span><span class="p">,</span>
+                 <span class="n">model_name</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
+                 <span class="n">version_name</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
+                 <span class="n">uri</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
+                 <span class="n">max_worker_count</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
+                 <span class="n">runtime_version</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
+                 <span class="n">gcp_conn_id</span><span class="o">=</span><span class="s1">&#39;google_cloud_default&#39;</span><span class="p">,</span>
+                 <span class="n">delegate_to</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
+                 <span class="o">*</span><span class="n">args</span><span class="p">,</span>
+                 <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
+        <span class="nb">super</span><span class="p">(</span><span class="n">MLEngineBatchPredictionOperator</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
+
+        <span class="bp">self</span><span class="o">.</span><span class="n">project_id</span> <span class="o">=</span> <span class="n">project_id</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">gcp_conn_id</span> <span class="o">=</span> <span class="n">gcp_conn_id</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">delegate_to</span> <span class="o">=</span> <span class="n">delegate_to</span>
+
+        <span class="k">try</span><span class="p">:</span>
+            <span class="n">prediction_input</span> <span class="o">=</span> <span class="n">_create_prediction_input</span><span class="p">(</span>
+                <span class="n">project_id</span><span class="p">,</span> <span class="n">region</span><span class="p">,</span> <span class="n">data_format</span><span class="p">,</span> <span class="n">input_paths</span><span class="p">,</span> <span class="n">output_path</span><span class="p">,</span>
+                <span class="n">model_name</span><span class="p">,</span> <span class="n">version_name</span><span class="p">,</span> <span class="n">uri</span><span class="p">,</span> <span class="n">max_worker_count</span><span class="p">,</span>
+                <span class="n">runtime_version</span><span class="p">)</span>
+        <span class="k">except</span> <span class="ne">ValueError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span>
+                <span class="s1">&#39;Cannot create batch prediction job request due to: </span><span class="si">%s</span><span class="s1">&#39;</span><span class="p">,</span>
+                <span class="n">e</span>
+            <span class="p">)</span>
+            <span class="k">raise</span>
+
+        <span class="bp">self</span><span class="o">.</span><span class="n">prediction_job_request</span> <span class="o">=</span> <span class="p">{</span>
+            <span class="s1">&#39;jobId&#39;</span><span class="p">:</span> <span class="n">_normalize_mlengine_job_id</span><span class="p">(</span><span class="n">job_id</span><span class="p">),</span>
+            <span class="s1">&#39;predictionInput&#39;</span><span class="p">:</span> <span class="n">prediction_input</span>
+        <span class="p">}</span>
+
+    <span class="k">def</span> <span class="nf">execute</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
+        <span class="n">hook</span> <span class="o">=</span> <span class="n">MLEngineHook</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">gcp_conn_id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">delegate_to</span><span class="p">)</span>
+
+        <span class="k">def</span> <span class="nf">check_existing_job</span><span class="p">(</span><span class="n">existing_job</span><span class="p">):</span>
+            <span class="k">return</span> <span class="n">existing_job</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;predictionInput&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> <span class="o">==</span> \
+                <span class="bp">self</span><span class="o">.</span><span class="n">prediction_job_request</span><span class="p">[</span><span class="s1">&#39;predictionInput&#39;</span><span class="p">]</span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="n">finished_prediction_job</span> <span class="o">=</span> <span class="n">hook</span><span class="o">.</span><span class="n">create_job</span><span class="p">(</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">project_id</span><span class="p">,</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">prediction_job_request</span><span class="p">,</span>
+                <span class="n">check_existing_job</span><span class="p">)</span>
+        <span class="k">except</span> <span class="n">errors</span><span class="o">.</span><span class="n">HttpError</span><span class="p">:</span>
+            <span class="k">raise</span>
+
+        <span class="k">if</span> <span class="n">finished_prediction_job</span><span class="p">[</span><span class="s1">&#39;state&#39;</span><span class="p">]</span> <span class="o">!=</span> <span class="s1">&#39;SUCCEEDED&#39;</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span>
+                <span class="s1">&#39;Batch prediction job failed: </span><span class="si">%s</span><span class="s1">&#39;</span><span class="p">,</span>
+                <span class="nb">str</span><span class="p">(</span><span class="n">finished_prediction_job</span><span class="p">))</span>
+            <span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="n">finished_prediction_job</span><span class="p">[</span><span class="s1">&#39;errorMessage&#39;</span><span class="p">])</span>
+
+        <span class="k">return</span> <span class="n">finished_prediction_job</span><span class="p">[</span><span class="s1">&#39;predictionOutput&#39;</span><span class="p">]</span></div>
+
+
+<div class="viewcode-block" id="MLEngineModelOperator"><a class="viewcode-back" href="../../../../integration.html#airflow.contrib.operators.mlengine_operator.MLEngineModelOperator">[docs]</a><span class="k">class</span> <span class="nc">MLEngineModelOperator</span><span class="p">(</span><span class="n">BaseOperator</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Operator for managing a Google Cloud ML Engine model.</span>
+
+<span class="sd">    :param project_id: The Google Cloud project name to which MLEngine</span>
+<span class="sd">        model belongs.</span>
+<span class="sd">    :type project_id: string</span>
+
+<span class="sd">    :param model: A dictionary containing the information about the model.</span>
+<span class="sd">        If the `operation` is `create`, then the `model` parameter should</span>
+<span class="sd">        contain all the information about this model such as `name`.</span>
+
+<span class="sd">        If the `operation` is `get`, the `model` parameter</span>
+<span class="sd">        should contain the `name` of the model.</span>
+<span class="sd">    :type model: dict</span>
+
+<span class="sd">    :param operation: The operation to perform. Available operations are:</span>
+<span class="sd">        &#39;create&#39;: Creates a new model as provided by the `model` parameter.</span>
+<span class="sd">        &#39;get&#39;: Gets a particular model where the name is specified in `model`.</span>
+
+<span class="sd">    :param gcp_conn_id: The connection ID to use when fetching connection info.</span>
+<span class="sd">    :type gcp_conn_id: string</span>
+
+<span class="sd">    :param delegate_to: The account to impersonate, if any.</span>
+<span class="sd">        For this to work, the service account making the request must have</span>
+<span class="sd">        domain-wide delegation enabled.</span>
+<span class="sd">    :type delegate_to: string</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+
+    <span class="n">template_fields</span> <span class="o">=</span> <span class="p">[</span>
+        <span class="s1">&#39;_model&#39;</span><span class="p">,</span>
+    <span class="p">]</span>
+
+    <span class="nd">@apply_defaults</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
+                 <span class="n">project_id</span><span class="p">,</span>
+                 <span class="n">model</span><span class="p">,</span>
+                 <span class="n">operation</span><span class="o">=</span><span class="s1">&#39;create&#39;</span><span class="p">,</span>
+                 <span class="n">gcp_conn_id</span><span class="o">=</span><span class="s1">&#39;google_cloud_default&#39;</span><span class="p">,</span>
+                 <span class="n">delegate_to</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
+                 <span class="o">*</span><span class="n">args</span><span class="p">,</span>
+                 <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
+        <span class="nb">super</span><span class="p">(</span><span class="n">MLEngineModelOperator</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_project_id</span> <span class="o">=</span> <span class="n">project_id</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_model</span> <span class="o">=</span> <span class="n">model</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_operation</span> <span class="o">=</span> <span class="n">operation</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_gcp_conn_id</span> <span class="o">=</span> <span class="n">gcp_conn_id</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_delegate_to</span> <span class="o">=</span> <span class="n">delegate_to</span>
+
+    <span class="k">def</span> <span class="nf">execute</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
+        <span class="n">hook</span> <span class="o">=</span> <span class="n">MLEngineHook</span><span class="p">(</span>
+            <span class="n">gcp_conn_id</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_gcp_conn_id</span><span class="p">,</span> <span class="n">delegate_to</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_delegate_to</span><span class="p">)</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_operation</span> <span class="o">==</span> <span class="s1">&#39;create&#39;</span><span class="p">:</span>
+            <span class="k">return</span> <span class="n">hook</span><span class="o">.</span><span class="n">create_model</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_project_id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_model</span><span class="p">)</span>
+        <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">_operation</span> <span class="o">==</span> <span class="s1">&#39;get&#39;</span><span class="p">:</span>
+            <span class="k">return</span> <span class="n">hook</span><span class="o">.</span><span class="n">get_model</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_project_id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_model</span><span class="p">[</span><span class="s1">&#39;name&#39;</span><span class="p">])</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s1">&#39;Unknown operation: </span><span class="si">{}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_operation</span><span class="p">))</span></div>
+
+
+<div class="viewcode-block" id="MLEngineVersionOperator"><a class="viewcode-back" href="../../../../integration.html#airflow.contrib.operators.mlengine_operator.MLEngineVersionOperator">[docs]</a><span class="k">class</span> <span class="nc">MLEngineVersionOperator</span><span class="p">(</span><span class="n">BaseOperator</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Operator for managing a Google Cloud ML Engine version.</span>
+
+<span class="sd">    :param project_id: The Google Cloud project name to which MLEngine</span>
+<span class="sd">        model belongs.</span>
+<span class="sd">    :type project_id: string</span>
+
+<span class="sd">    :param model_name: The name of the Google Cloud ML Engine model that the version</span>
+<span class="sd">        belongs to.</span>
+<span class="sd">    :type model_name: string</span>
+
+<span class="sd">    :param version_name: A name to use for the version being operated upon. If</span>
+<span class="sd">        not None and the `version` argument is None or does not have a value for</span>
+<span class="sd">        the `name` key, then this will be populated in the payload for the</span>
+<span class="sd">        `name` key.</span>
+<span class="sd">    :type version_name: string</span>
+
+<span class="sd">    :param version: A dictionary containing the information about the version.</span>
+<span class="sd">        If the `operation` is `create`, `version` should contain all the</span>
+<span class="sd">        information about this version such as name, and deploymentUrl.</span>
+<span class="sd">        If the `operation` is `get` or `delete`, the `version` parameter</span>
+<span class="sd">        should contain the `name` of the version.</span>
+<span class="sd">        If it is None, the only `operation` possible would be `list`.</span>
+<span class="sd">    :type version: dict</span>
+
+<span class="sd">    :param operation: The operation to perform. Available operations are:</span>
+<span class="sd">        &#39;create&#39;: Creates a new version in the model specified by `model_name`,</span>
+<span class="sd">            in which case the `version` parameter should contain all the</span>
+<span class="sd">            information to create that version</span>
+<span class="sd">            (e.g. `name`, `deploymentUrl`).</span>
+<span class="sd">        &#39;get&#39;: Gets full information of a particular version in the model</span>
+<span class="sd">            specified by `model_name`.</span>
+<span class="sd">            The name of the version should be specified in the `version`</span>
+<span class="sd">            parameter.</span>
+
+<span class="sd">        &#39;list&#39;: Lists all available versions of the model specified</span>
+<span class="sd">            by `model_name`.</span>
+
+<span class="sd">        &#39;delete&#39;: Deletes the version specified in `version` parameter from the</span>
+<span class="sd">            model specified by `model_name`).</span>
+<span class="sd">            The name of the version should be specified in the `version`</span>
+<span class="sd">            parameter.</span>
+<span class="sd">     :type operation: string</span>
+
+<span class="sd">    :param gcp_conn_id: The connection ID to use when fetching connection info.</span>
+<span class="sd">    :type gcp_conn_id: string</span>
+
+<span class="sd">    :param delegate_to: The account to impersonate, if any.</span>
+<span class="sd">        For this to work, the service account making the request must have</span>
+<span class="sd">        domain-wide delegation enabled.</span>
+<span class="sd">    :type delegate_to: string</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+
+    <span class="n">template_fields</span> <span class="o">=</span> <span class="p">[</span>
+        <span class="s1">&#39;_model_name&#39;</span><span class="p">,</span>
+        <span class="s1">&#39;_version_name&#39;</span><span class="p">,</span>
+        <span class="s1">&#39;_version&#39;</span><span class="p">,</span>
+    <span class="p">]</span>
+
+    <span class="nd">@apply_defaults</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
+                 <span class="n">project_id</span><span class="p">,</span>
+                 <span class="n">model_name</span><span class="p">,</span>
+                 <span class="n">version_name</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
+                 <span class="n">version</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
+                 <span class="n">operation</span><span class="o">=</span><span class="s1">&#39;create&#39;</span><span class="p">,</span>
+                 <span class="n">gcp_conn_id</span><span class="o">=</span><span class="s1">&#39;google_cloud_default&#39;</span><span class="p">,</span>
+                 <span class="n">delegate_to</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
+                 <span class="o">*</span><span class="n">args</span><span class="p">,</span>
+                 <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
+
+        <span class="nb">super</span><span class="p">(</span><span class="n">MLEngineVersionOperator</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_project_id</span> <span class="o">=</span> <span class="n">project_id</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_model_name</span> <span class="o">=</span> <span class="n">model_name</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_version_name</span> <span class="o">=</span> <span class="n">version_name</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_version</span> <span class="o">=</span> <span class="n">version</span> <span class="ow">or</span> <span class="p">{}</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_operation</span> <span class="o">=</span> <span class="n">operation</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_gcp_conn_id</span> <span class="o">=</span> <span class="n">gcp_conn_id</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_delegate_to</span> <span class="o">=</span> <span class="n">delegate_to</span>
+
+    <span class="k">def</span> <span class="nf">execute</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
+        <span class="k">if</span> <span class="s1">&#39;name&#39;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_version</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">_version</span><span class="p">[</span><span class="s1">&#39;name&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_version_name</span>
+
+        <span class="n">hook</span> <span class="o">=</span> <span class="n">MLEngineHook</span><span class="p">(</span>
+            <span class="n">gcp_conn_id</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_gcp_conn_id</span><span class="p">,</span> <span class="n">delegate_to</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_delegate_to</span><span class="p">)</span>
+
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_operation</span> <span class="o">==</span> <span class="s1">&#39;create&#39;</span><span class="p">:</span>
+            <span class="k">assert</span> <span class="bp">self</span><span class="o">.</span><span class="n">_version</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span>
+            <span class="k">return</span> <span class="n">hook</span><span class="o">.</span><span class="n">create_version</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_project_id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_model_name</span><span class="p">,</span>
+                                       <span class="bp">self</span><span class="o">.</span><span class="n">_version</span><span class="p">)</span>
+        <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">_operation</span> <span class="o">==</span> <span class="s1">&#39;set_default&#39;</span><span class="p">:</span>
+            <span class="k">return</span> <span class="n">hook</span><span class="o">.</span><span class="n">set_default_version</span><span class="p">(</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">_project_id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_model_name</span><span class="p">,</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">_version</span><span class="p">[</span><span class="s1">&#39;name&#39;</span><span class="p">])</span>
+        <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">_operation</span> <span class="o">==</span> <span class="s1">&#39;list&#39;</span><span class="p">:</span>
+            <span class="k">return</span> <span class="n">hook</span><span class="o">.</span><span class="n">list_versions</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_project_id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_model_name</span><span class="p">)</span>
+        <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">_operation</span> <span class="o">==</span> <span class="s1">&#39;delete&#39;</span><span class="p">:</span>
+            <span class="k">return</span> <span class="n">hook</span><span class="o">.</span><span class="n">delete_version</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_project_id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_model_name</span><span class="p">,</span>
+                                       <span class="bp">self</span><span class="o">.</span><span class="n">_version</span><span class="p">[</span><span class="s1">&#39;name&#39;</span><span class="p">])</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s1">&#39;Unknown operation: </span><span class="si">{}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_operation</span><span class="p">))</span></div>
+
+
+<div class="viewcode-block" id="MLEngineTrainingOperator"><a class="viewcode-back" href="../../../../integration.html#airflow.contrib.operators.mlengine_operator.MLEngineTrainingOperator">[docs]</a><span class="k">class</span> <span class="nc">MLEngineTrainingOperator</span><span class="p">(</span><span class="n">BaseOperator</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Operator for launching a MLEngine training job.</span>
+
+<span class="sd">    :param project_id: The Google Cloud project name within which MLEngine</span>
+<span class="sd">        training job should run. This field could be templated.</span>
+<span class="sd">    :type project_id: string</span>
+
+<span class="sd">    :param job_id: A unique templated id for the submitted Google MLEngine</span>
+<span class="sd">        training job.</span>
+<span class="sd">    :type job_id: string</span>
+
+<span class="sd">    :param package_uris: A list of package locations for MLEngine training job,</span>
+<span class="sd">        which should include the main training program + any additional</span>
+<span class="sd">        dependencies.</span>
+<span class="sd">    :type package_uris: string</span>
+
+<span class="sd">    :param training_python_module: The Python module name to run within MLEngine</span>
+<span class="sd">        training job after installing &#39;package_uris&#39; packages.</span>
+<span class="sd">    :type training_python_module: string</span>
+
+<span class="sd">    :param training_args: A list of templated command line arguments to pass to</span>
+<span class="sd">        the MLEngine training program.</span>
+<span class="sd">    :type training_args: string</span>
+
+<span class="sd">    :param region: The Google Compute Engine region to run the MLEngine training</span>
+<span class="sd">        job in. This field could be templated.</span>
+<span class="sd">    :type region: string</span>
+
+<span class="sd">    :param scale_tier: Resource tier for MLEngine training job.</span>
+<span class="sd">    :type scale_tier: string</span>
+
+<span class="sd">    :param gcp_conn_id: The connection ID to use when fetching connection info.</span>
+<span class="sd">    :type gcp_conn_id: string</span>
+
+<span class="sd">    :param delegate_to: The account to impersonate, if any.</span>
+<span class="sd">        For this to work, the service account making the request must have</span>
+<span class="sd">        domain-wide delegation enabled.</span>
+<span class="sd">    :type delegate_to: string</span>
+
+<span class="sd">    :param mode: Can be one of &#39;DRY_RUN&#39;/&#39;CLOUD&#39;. In &#39;DRY_RUN&#39; mode, no real</span>
+<span class="sd">        training job will be launched, but the MLEngine training job request</span>
+<span class="sd">        will be printed out. In &#39;CLOUD&#39; mode, a real MLEngine training job</span>
+<span class="sd">        creation request will be issued.</span>
+<span class="sd">    :type mode: string</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+
+    <span class="n">template_fields</span> <span class="o">=</span> <span class="p">[</span>
+        <span class="s1">&#39;_project_id&#39;</span><span class="p">,</span>
+        <span class="s1">&#39;_job_id&#39;</span><span class="p">,</span>
+        <span class="s1">&#39;_package_uris&#39;</span><span class="p">,</span>
+        <span class="s1">&#39;_training_python_module&#39;</span><span class="p">,</span>
+        <span class="s1">&#39;_training_args&#39;</span><span class="p">,</span>
+        <span class="s1">&#39;_region&#39;</span><span class="p">,</span>
+        <span class="s1">&#39;_scale_tier&#39;</span><span class="p">,</span>
+    <span class="p">]</span>
+
+    <span class="nd">@apply_defaults</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
+                 <span class="n">project_id</span><span class="p">,</span>
+                 <span class="n">job_id</span><span class="p">,</span>
+                 <span class="n">package_uris</span><span class="p">,</span>
+                 <span class="n">training_python_module</span><span class="p">,</span>
+                 <span class="n">training_args</span><span class="p">,</span>
+                 <span class="n">region</span><span class="p">,</span>
+                 <span class="n">scale_tier</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
+                 <span class="n">gcp_conn_id</span><span class="o">=</span><span class="s1">&#39;google_cloud_default&#39;</span><span class="p">,</span>
+                 <span class="n">delegate_to</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
+                 <span class="n">mode</span><span class="o">=</span><span class="s1">&#39;PRODUCTION&#39;</span><span class="p">,</span>
+                 <span class="o">*</span><span class="n">args</span><span class="p">,</span>
+                 <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
+        <span class="nb">super</span><span class="p">(</span><span class="n">MLEngineTrainingOperator</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_project_id</span> <span class="o">=</span> <span class="n">project_id</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_job_id</span> <span class="o">=</span> <span class="n">job_id</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_package_uris</span> <span class="o">=</span> <span class="n">package_uris</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_training_python_module</span> <span class="o">=</span> <span class="n">training_python_module</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_training_args</span> <span class="o">=</span> <span class="n">training_args</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_region</span> <span class="o">=</span> <span class="n">region</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_scale_tier</span> <span class="o">=</span> <span class="n">scale_tier</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_gcp_conn_id</span> <span class="o">=</span> <span class="n">gcp_conn_id</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_delegate_to</span> <span class="o">=</span> <span class="n">delegate_to</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_mode</span> <span class="o">=</span> <span class="n">mode</span>
+
+        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">_project_id</span><span class="p">:</span>
+            <span class="k">raise</span> <span class="n">AirflowException</span><span class="p">(</span><span class="s1">&#39;Google Cloud project id is required.&#39;</span><span class="p">)</span>
+        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">_job_id</span><span class="p">:</span>
+            <span class="k">raise</span> <span class="n">AirflowException</span><span class="p">(</span>
+                <span class="s1">&#39;An unique job id is required for Google MLEngine training &#39;</span>
+                <span class="s1">&#39;job.&#39;</span><span class="p">)</span>
+        <span class="k">if</span> <span class="ow">not</span> <span class="n">package_uris</span><span class="p">:</span>
+            <span class="k">raise</span> <span class="n">AirflowException</span><span class="p">(</span>
+                <span class="s1">&#39;At least one python package is required for MLEngine &#39;</span>
+                <span class="s1">&#39;Training job.&#39;</span><span class="p">)</span>
+        <span class="k">if</span> <span class="ow">not</span> <span class="n">training_python_module</span><span class="p">:</span>
+            <span class="k">raise</span> <span class="n">AirflowException</span><span class="p">(</span>
+                <span class="s1">&#39;Python module name to run after installing required &#39;</span>
+                <span class="s1">&#39;packages is required.&#39;</span><span class="p">)</span>
+        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">_region</span><span class="p">:</span>
+            <span class="k">raise</span> <span class="n">AirflowException</span><span class="p">(</span><span class="s1">&#39;Google Compute Engine region is required.&#39;</span><span class="p">)</span>
+
+    <span class="k">def</span> <span class="nf">execute</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
+        <span class="n">job_id</span> <span class="o">=</span> <span class="n">_normalize_mlengine_job_id</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_job_id</span><span class="p">)</span>
+        <span class="n">training_request</span> <span class="o">=</span> <span class="p">{</span>
+            <span class="s1">&#39;jobId&#39;</span><span class="p">:</span> <span class="n">job_id</span><span class="p">,</span>
+            <span class="s1">&#39;trainingInput&#39;</span><span class="p">:</span> <span class="p">{</span>
+                <span class="s1">&#39;scaleTier&#39;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_scale_tier</span><span class="p">,</span>
+                <span class="s1">&#39;packageUris&#39;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_package_uris</span><span class="p">,</span>
+                <span class="s1">&#39;pythonModule&#39;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_training_python_module</span><span class="p">,</span>
+                <span class="s1">&#39;region&#39;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_region</span><span class="p">,</span>
+                <span class="s1">&#39;args&#39;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_training_args</span><span class="p">,</span>
+            <span class="p">}</span>
+        <span class="p">}</span>
+
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_mode</span> <span class="o">==</span> <span class="s1">&#39;DRY_RUN&#39;</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s1">&#39;In dry_run mode.&#39;</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s1">&#39;MLEngine Training job request is: </span><span class="si">{}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">training_request</span><span class="p">))</span>
+            <span class="k">return</span>
+
+        <span class="n">hook</span> <span class="o">=</span> <span class="n">MLEngineHook</span><span class="p">(</span>
+            <span class="n">gcp_conn_id</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_gcp_conn_id</span><span class="p">,</span> <span class="n">delegate_to</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_delegate_to</span><span class="p">)</span>
+
+        <span class="c1"># Helper method to check if the existing job&#39;s training input is the</span>
+        <span class="c1"># same as the request we get here.</span>
+        <span class="k">def</span> <span class="nf">check_existing_job</span><span class="p">(</span><span class="n">existing_job</span><span class="p">):</span>
+            <span class="k">return</span> <span class="n">existing_job</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;trainingInput&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> <span class="o">==</span> \
+                <span class="n">training_request</span><span class="p">[</span><span class="s1">&#39;trainingInput&#39;</span><span class="p">]</span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="n">finished_training_job</span> <span class="o">=</span> <span class="n">hook</span><span class="o">.</span><span class="n">create_job</span><span class="p">(</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">_project_id</span><span class="p">,</span> <span class="n">training_request</span><span class="p">,</span> <span class="n">check_existing_job</span><span class="p">)</span>
+        <span class="k">except</span> <span class="n">errors</span><span class="o">.</span><span class="n">HttpError</span><span class="p">:</span>
+            <span class="k">raise</span>
+
+        <span class="k">if</span> <span class="n">finished_training_job</span><span class="p">[</span><span class="s1">&#39;state&#39;</span><span class="p">]</span> <span class="o">!=</span> <span class="s1">&#39;SUCCEEDED&#39;</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s1">&#39;MLEngine training job failed: </span><span class="si">{}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span>
+                <span class="nb">str</span><span class="p">(</span><span class="n">finished_training_job</span><span class="p">)))</span>
+            <span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="n">finished_training_job</span><span class="p">[</span><span class="s1">&#39;errorMessage&#39;</span><span class="p">])</span></div>
+</pre></div>
+
+           </div>
+           <div class="articleComments">
+            
+           </div>
+          </div>
+          <footer>
+  
+
+  <hr/>
+
+  <div role="contentinfo">
+    <p>
+
+    </p>
+  </div>
+  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/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">
+        var DOCUMENTATION_OPTIONS = {
+            URL_ROOT:'../../../../',
+            VERSION:'',
+            COLLAPSE_INDEX:false,
+            FILE_SUFFIX:'.html',
+            HAS_SOURCE:  true,
+            SOURCELINK_SUFFIX: '.txt'
+        };
+    </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/js/theme.js"></script>
+  
+
+  
+  
+  <script type="text/javascript">
+      jQuery(function () {
+          SphinxRtdTheme.StickyNav.enable();
+      });
+  </script>
+   
+
+</body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-airflow-site/blob/28a3eb60/_modules/airflow/contrib/sensors/wasb_sensor.html
----------------------------------------------------------------------
diff --git a/_modules/airflow/contrib/sensors/wasb_sensor.html b/_modules/airflow/contrib/sensors/wasb_sensor.html
new file mode 100644
index 0000000..a1a8d95
--- /dev/null
+++ b/_modules/airflow/contrib/sensors/wasb_sensor.html
@@ -0,0 +1,327 @@
+
+
+<!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.contrib.sensors.wasb_sensor &mdash; Airflow Documentation</title>
+  
+
+  
+  
+  
+  
+
+  
+
+  
+  
+    
+
+  
+
+  
+  
+    <link rel="stylesheet" href="../../../../_static/css/theme.css" type="text/css" />
+  
+
+  
+
+  
+        <link rel="index" title="Index"
+              href="../../../../genindex.html"/>
+        <link rel="search" title="Search" href="../../../../search.html"/>
+    <link rel="top" title="Airflow Documentation" href="../../../../index.html"/>
+        <link rel="up" title="Module code" href="../../../index.html"/> 
+
+  
+  <script src="../../../../_static/js/modernizr.min.js"></script>
+
+</head>
+
+<body class="wy-body-for-nav" role="document">
+
+   
+  <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 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>
+<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="../../../../configuration.html">Configuration</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="../../../../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="../../../../faq.html">FAQ</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../../../code.html">API Reference</a></li>
+</ul>
+
+            
+          
+        </div>
+      </div>
+    </nav>
+
+    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
+
+      
+      <nav class="wy-nav-top" role="navigation" 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">Module code</a> &raquo;</li>
+        
+      <li>airflow.contrib.sensors.wasb_sensor</li>
+    
+    
+      <li class="wy-breadcrumbs-aside">
+        
+            
+        
+      </li>
+    
+  </ul>
+
+  
+  <hr/>
+</div>
+          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
+           <div itemprop="articleBody">
+            
+  <h1>Source code for airflow.contrib.sensors.wasb_sensor</h1><div class="highlight"><pre>
+<span></span><span class="c1"># -*- coding: utf-8 -*-</span>
+<span class="c1">#</span>
+<span class="c1"># Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span>
+<span class="c1"># you may not use this file except in compliance with the License.</span>
+<span class="c1"># You may obtain a copy of the License at</span>
+<span class="c1">#</span>
+<span class="c1"># http://www.apache.org/licenses/LICENSE-2.0</span>
+<span class="c1">#</span>
+<span class="c1"># Unless required by applicable law or agreed to in writing, software</span>
+<span class="c1"># distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span>
+<span class="c1"># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
+<span class="c1"># See the License for the specific language governing permissions and</span>
+<span class="c1"># limitations under the License.</span>
+<span class="c1">#</span>
+<span class="kn">from</span> <span class="nn">airflow.contrib.hooks.wasb_hook</span> <span class="k">import</span> <span class="n">WasbHook</span>
+<span class="kn">from</span> <span class="nn">airflow.operators.sensors</span> <span class="k">import</span> <span class="n">BaseSensorOperator</span>
+<span class="kn">from</span> <span class="nn">airflow.utils.decorators</span> <span class="k">import</span> <span class="n">apply_defaults</span>
+
+
+<div class="viewcode-block" id="WasbBlobSensor"><a class="viewcode-back" href="../../../../integration.html#airflow.contrib.sensors.wasb_sensor.WasbBlobSensor">[docs]</a><span class="k">class</span> <span class="nc">WasbBlobSensor</span><span class="p">(</span><span class="n">BaseSensorOperator</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Waits for a blob to arrive on Azure Blob Storage.</span>
+
+<span class="sd">    :param container_name: Name of the container.</span>
+<span class="sd">    :type container_name: str</span>
+<span class="sd">    :param blob_name: Name of the blob.</span>
+<span class="sd">    :type blob_name: str</span>
+<span class="sd">    :param wasb_conn_id: Reference to the wasb connection.</span>
+<span class="sd">    :type wasb_conn_id: str</span>
+<span class="sd">    :param check_options: Optional keyword arguments that</span>
+<span class="sd">        `WasbHook.check_for_blob()` takes.</span>
+<span class="sd">    :type check_options: dict</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+
+    <span class="n">template_fields</span> <span class="o">=</span> <span class="p">(</span><span class="s1">&#39;container_name&#39;</span><span class="p">,</span> <span class="s1">&#39;blob_name&#39;</span><span class="p">)</span>
+
+    <span class="nd">@apply_defaults</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">container_name</span><span class="p">,</span> <span class="n">blob_name</span><span class="p">,</span>
+                 <span class="n">wasb_conn_id</span><span class="o">=</span><span class="s1">&#39;wasb_default&#39;</span><span class="p">,</span> <span class="n">check_options</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span>
+                 <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
+        <span class="nb">super</span><span class="p">(</span><span class="n">WasbBlobSensor</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
+        <span class="k">if</span> <span class="n">check_options</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
+            <span class="n">check_options</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">wasb_conn_id</span> <span class="o">=</span> <span class="n">wasb_conn_id</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">container_name</span> <span class="o">=</span> <span class="n">container_name</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">blob_name</span> <span class="o">=</span> <span class="n">blob_name</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">check_options</span> <span class="o">=</span> <span class="n">check_options</span>
+
+    <span class="k">def</span> <span class="nf">poke</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span>
+            <span class="s1">&#39;Poking for blob: </span><span class="si">{self.blob_name}</span><span class="se">\n</span><span class="s1">&#39;</span>
+            <span class="s1">&#39;in wasb://</span><span class="si">{self.container_name}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="o">**</span><span class="nb">locals</span><span class="p">())</span>
+        <span class="p">)</span>
+        <span class="n">hook</span> <span class="o">=</span> <span class="n">WasbHook</span><span class="p">(</span><span class="n">wasb_conn_id</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">wasb_conn_id</span><span class="p">)</span>
+        <span class="k">return</span> <span class="n">hook</span><span class="o">.</span><span class="n">check_for_blob</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">container_name</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">blob_name</span><span class="p">,</span>
+                                   <span class="o">**</span><span class="bp">self</span><span class="o">.</span><span class="n">check_options</span><span class="p">)</span></div>
+
+
+<div class="viewcode-block" id="WasbPrefixSensor"><a class="viewcode-back" href="../../../../integration.html#airflow.contrib.sensors.wasb_sensor.WasbPrefixSensor">[docs]</a><span class="k">class</span> <span class="nc">WasbPrefixSensor</span><span class="p">(</span><span class="n">BaseSensorOperator</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Waits for blobs matching a prefix to arrive on Azure Blob Storage.</span>
+
+<span class="sd">    :param container_name: Name of the container.</span>
+<span class="sd">    :type container_name: str</span>
+<span class="sd">    :param prefix: Prefix of the blob.</span>
+<span class="sd">    :type prefix: str</span>
+<span class="sd">    :param wasb_conn_id: Reference to the wasb connection.</span>
+<span class="sd">    :type wasb_conn_id: str</span>
+<span class="sd">    :param check_options: Optional keyword arguments that</span>
+<span class="sd">        `WasbHook.check_for_prefix()` takes.</span>
+<span class="sd">    :type check_options: dict</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+
+    <span class="n">template_fields</span> <span class="o">=</span> <span class="p">(</span><span class="s1">&#39;container_name&#39;</span><span class="p">,</span> <span class="s1">&#39;prefix&#39;</span><span class="p">)</span>
+
+    <span class="nd">@apply_defaults</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">container_name</span><span class="p">,</span> <span class="n">prefix</span><span class="p">,</span> <span class="n">wasb_conn_id</span><span class="o">=</span><span class="s1">&#39;wasb_default&#39;</span><span class="p">,</span>
+                 <span class="n">check_options</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
+        <span class="nb">super</span><span class="p">(</span><span class="n">WasbPrefixSensor</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
+        <span class="k">if</span> <span class="n">check_options</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
+            <span class="n">check_options</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">wasb_conn_id</span> <span class="o">=</span> <span class="n">wasb_conn_id</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">container_name</span> <span class="o">=</span> <span class="n">container_name</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">prefix</span> <span class="o">=</span> <span class="n">prefix</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">check_options</span> <span class="o">=</span> <span class="n">check_options</span>
+
+    <span class="k">def</span> <span class="nf">poke</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span>
+            <span class="s1">&#39;Poking for prefix: </span><span class="si">{self.prefix}</span><span class="se">\n</span><span class="s1">&#39;</span>
+            <span class="s1">&#39;in wasb://</span><span class="si">{self.container_name}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="o">**</span><span class="nb">locals</span><span class="p">())</span>
+        <span class="p">)</span>
+        <span class="n">hook</span> <span class="o">=</span> <span class="n">WasbHook</span><span class="p">(</span><span class="n">wasb_conn_id</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">wasb_conn_id</span><span class="p">)</span>
+        <span class="k">return</span> <span class="n">hook</span><span class="o">.</span><span class="n">check_for_prefix</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">container_name</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">prefix</span><span class="p">,</span>
+                                     <span class="o">**</span><span class="bp">self</span><span class="o">.</span><span class="n">check_options</span><span class="p">)</span></div>
+</pre></div>
+
+           </div>
+           <div class="articleComments">
+            
+           </div>
+          </div>
+          <footer>
+  
+
+  <hr/>
+
+  <div role="contentinfo">
+    <p>
+
+    </p>
+  </div>
+  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/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">
+        var DOCUMENTATION_OPTIONS = {
+            URL_ROOT:'../../../../',
+            VERSION:'',
+            COLLAPSE_INDEX:false,
+            FILE_SUFFIX:'.html',
+            HAS_SOURCE:  true,
+            SOURCELINK_SUFFIX: '.txt'
+        };
+    </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/js/theme.js"></script>
+  
+
+  
+  
+  <script type="text/javascript">
+      jQuery(function () {
+          SphinxRtdTheme.StickyNav.enable();
+      });
+  </script>
+   
+
+</body>
+</html>
\ No newline at end of file


Mime
View raw message