No module named 'gcp_sql_operator' in cloud composer

梦想与她 提交于 2020-01-06 08:00:19

问题


I am not able to import statement as-

from airflow.contrib.operators.gcp_sql_operator import CloudSqlQueryOperator

I want to import this in my DAG file which will be run in cloud composer airflow whose version is 1.10.0 and not 1.9.0.Here just to check, I tried to import gcs_to_gcs as-

from airflow.contrib.operators.gcs_to_gcs import GoogleCloudStorageToGoogleCloudStorageOperator

I am able to import this but not gcp_sql_operator.


回答1:


The CloudSqlQueryOperator operator is released since Airflow 1.10.2, which is currently not supported in Composer versions. The support for 1.10.2 should be available soon in Composer, before that you may want to manually copy gcp_sql_operator.py and its dependencies to the Composer dags folder following the instruction here.



来源:https://stackoverflow.com/questions/55585503/no-module-named-gcp-sql-operator-in-cloud-composer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!