airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msu...@apache.org
Subject incubator-airflow git commit: [AIRFLOW-592] example_xcom import Error
Date Tue, 25 Oct 2016 05:03:40 GMT
Repository: incubator-airflow
Updated Branches:
  refs/heads/master 928fa986c -> c49d0b36b


[AIRFLOW-592] example_xcom import Error

fix exmple_xcom import error:
AttributeError: 'module' object has no attribute
'python_operator'

Closes #1853 from forevernull/master


Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/c49d0b36
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/c49d0b36
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/c49d0b36

Branch: refs/heads/master
Commit: c49d0b36b20c5e69453aef6082f2175ff37a9a98
Parents: 928fa98
Author: forevernull <forevernull@163.com>
Authored: Tue Oct 25 10:33:17 2016 +0530
Committer: Sumit Maheshwari <sumitm@qubole.com>
Committed: Tue Oct 25 10:33:17 2016 +0530

----------------------------------------------------------------------
 airflow/example_dags/example_xcom.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/c49d0b36/airflow/example_dags/example_xcom.py
----------------------------------------------------------------------
diff --git a/airflow/example_dags/example_xcom.py b/airflow/example_dags/example_xcom.py
index ed8825c..50728c3 100644
--- a/airflow/example_dags/example_xcom.py
+++ b/airflow/example_dags/example_xcom.py
@@ -12,7 +12,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 from __future__ import print_function
-import airflow
+from airflow import DAG
+from airflow.operators.python_operator import PythonOperator
 from datetime import datetime, timedelta
 
 seven_days_ago = datetime.combine(
@@ -24,7 +25,7 @@ args = {
     'provide_context': True
 }
 
-dag = airflow.DAG(
+dag = DAG(
     'example_xcom',
     start_date=datetime(2015, 1, 1),
     schedule_interval="@once",
@@ -59,13 +60,13 @@ def puller(**kwargs):
     v1, v2 = ti.xcom_pull(key=None, task_ids=['push', 'push_by_returning'])
     assert (v1, v2) == (value_1, value_2)
 
-push1 = airflow.operators.python_operator.PythonOperator(
+push1 = PythonOperator(
     task_id='push', dag=dag, python_callable=push)
 
-push2 = airflow.operators.python_operator.PythonOperator(
+push2 = PythonOperator(
     task_id='push_by_returning', dag=dag, python_callable=push_by_returning)
 
-pull = airflow.operators.python_operator.PythonOperator(
+pull = PythonOperator(
     task_id='puller', dag=dag, python_callable=puller)
 
 pull.set_upstream([push1, push2])


Mime
View raw message