Skip to content

Commit

Permalink
[AIRFLOW-592] example_xcom import Error
Browse files Browse the repository at this point in the history
fix exmple_xcom import error:
AttributeError: 'module' object has no attribute
'python_operator'

Closes apache#1853 from forevernull/master
  • Loading branch information
forevernull authored and msumit committed Oct 25, 2016
1 parent 928fa98 commit c49d0b3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions airflow/example_dags/example_xcom.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -24,7 +25,7 @@
'provide_context': True
}

dag = airflow.DAG(
dag = DAG(
'example_xcom',
start_date=datetime(2015, 1, 1),
schedule_interval="@once",
Expand Down Expand Up @@ -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])

0 comments on commit c49d0b3

Please sign in to comment.