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)

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

airflow 实战

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

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)

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

airflow 实战

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-05
猜你喜欢
  • 2021-10-26
  • 2021-07-01
  • 2022-12-23
  • 2022-12-23
  • 2021-12-16
  • 2022-12-23
相关资源
相似解决方案