Google bigquery 使用气流从Google存储导出到BQ时出错

Google bigquery 使用气流从Google存储导出到BQ时出错,google-bigquery,airflow,Google Bigquery,Airflow,我正在尝试从Google云存储导出一个文件并将其加载到BigQuery。 执行此操作时,我收到以下错误: Traceback (most recent call last): File "/usr/local/lib/python2.7/site-packages/airflow/models.py", line 285, in process_file m = imp.load_source(mod_name, filepath) File "/root/airflow/dag

我正在尝试从Google云存储导出一个文件并将其加载到BigQuery。 执行此操作时,我收到以下错误:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/airflow/models.py", line 285, in process_file
    m = imp.load_source(mod_name, filepath)
  File "/root/airflow/dags/mysql_bi_invoices.py", line 8, in <module>
    from airflow.contrib.operators.mysql_to_gcs import MySqlToGoogleCloudStorageOperatorfrom
ImportError: cannot import name MySqlToGoogleCloudStorageOperatorfrom
Done.
[2018-04-20 15:21:30,773] {__init__.py:45} INFO - Using executor SequentialExecutor
[2018-04-20 15:21:30,858] {models.py:189} INFO - Filling up the DagBag from /root/airflow/dags
[2018-04-20 15:21:31,333] {models.py:288} ERROR - Failed to import: /root/airflow/dags/mysql_bi_invoices.py
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/airflow/models.py", line 285, in process_file
    m = imp.load_source(mod_name, filepath)
  File "/root/airflow/dags/mysql_bi_invoices.py", line 8, in <module>
    from airflow.contrib.operators.mysql_to_gcs import MySqlToGoogleCloudStorageOperatorfrom
ImportError: cannot import name MySqlToGoogleCloudStorageOperatorfrom
Traceback (most recent call last):
  File "/usr/local/bin/airflow", line 27, in <module>
    args.func(args)
  File "/usr/local/lib/python2.7/site-packages/airflow/bin/cli.py", line 516, in test
    dag = dag or get_dag(args)
  File "/usr/local/lib/python2.7/site-packages/airflow/bin/cli.py", line 130, in get_dag
    'parse.'.format(args.dag_id))
airflow.exceptions.AirflowException: dag_id could not be found: test. Either the dag did not exist or it failed to parse.

我试图添加/更改DAG的参数,但没有成功。任何见解都会有帮助

此错误与GBQ无关,请参阅错误消息:

airflow.exceptions.AirflowException: dag_id could not be found: test. Either the dag did not exist or it failed to parse.
首先检查是否可以将DAG与

airflow list_dags
如果这不起作用,则说明DAG中存在错误。此外,错误原因已存在于输出中:

ImportError: cannot import name MySqlToGoogleCloudStorageOperatorfrom
似乎是一个拼写错误,应该是

MySqlToGoogleCloudStorageOperator

在您的导入中。

此错误与GBQ无关,请参阅错误消息:

airflow.exceptions.AirflowException: dag_id could not be found: test. Either the dag did not exist or it failed to parse.
首先检查是否可以将DAG与

airflow list_dags
如果这不起作用,则说明DAG中存在错误。此外,错误原因已存在于输出中:

ImportError: cannot import name MySqlToGoogleCloudStorageOperatorfrom
似乎是一个拼写错误,应该是

MySqlToGoogleCloudStorageOperator
在你的进口