airflow 实战

def print_hello(*a,**b):
print a
print "========="
print b
print 'Hello world!'
raise ValueError("pre_paths or find_svr is null")
return {"hello":"Hello world!"}
 

t1 = PythonOperator(
task_id='print_hello',
#provide_context=True,
python_callable=print_hello,
op_kwargs={"aa":11,"bb":"22cc"},
op_args=[1,2,3,"zcy"],
dag=dag)

============结果如下

》》》》》》》》》》》》》》》》》》》》

def print_hello(bb,cc,**kwargs):
print "bb",bb
print "cc",cc
print "aa",kwargs
#print type(aa[1])

t1 = PythonOperator(
task_id='print_hello',
provide_context=True,
python_callable=print_hello,
op_args=[1,23],
op_kwargs={"sdf":"good"},
dag=dag)

==========结果如下

posted on 2018-03-08 20:18  我和你并没有不同  阅读(1032)  评论(0编辑  收藏  举报