当我运行脚本时,它不会提示我错误,但是不会执行将API中的数据存储到MYSQL中的任务。单独使用python脚本即可正常工作。
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from datetime import datetime, timedelta
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': datetime(2018, 10, 15),
'email': ['xxx@gmail.com'],
'email_on_failure': False,
'email_on_retry': False,
'retries': 1,
'retry_delay': timedelta(minutes=5),
# 'queue': 'bash_queue',
# 'pool': 'backfill',
# 'priority_weight': 10,
'end_date': datetime(2018, 10, 16),
}
#schedule_interval = "00 21 * * *"
schedule_interval = "* * * * *"
dag = DAG('tutorial', default_args=default_args, schedule_interval=schedule_interval)
t2 = BashOperator(
task_id= "RunPythonFile",
bash_command= "python /Users/joaopimenta/documents/joaopython/twitterscripts/twitterMigrateFollowersSQLMultipleUsers.py",
dag=dag
)