import papermill as pm
# ...
# define DAG, etc.
# ...
def copy_data_from_s3(**context):
pm.execute_notebook(
"copy_data_from_s3_step.ipynb",
"copy_data_from_s3_step.ipynb"
parameters=dict(date=context['execution_date'])) # pass some context parameter if you need to
)
最后,设置该步骤,也许作为 a (尽管如果您想从命令行运行 PapermillPythonOperator也可以使用 a )。要匹配上面的函数:BashOperator
copy_data = PythonOperator(dag=dag,
task_id='copy_data_task',
provide_context=True,
python_callable=copy_data_from_s3)
慕工程0101907
相关分类