Cloud Composer中没有名为'gcp_sql_operator'的模块 [英] No module named 'gcp_sql_operator' in cloud composer

查看:76
本文介绍了Cloud Composer中没有名为'gcp_sql_operator'的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法将语句导入为-

from airflow.contrib.operators.gcp_sql_operator import CloudSqlQueryOperator

我想将其导入到我的DAG文件中,该文件将在版本为1.10.0而不是1.9.0的cloud composer airflow中运行.这里只是检查一下,我试图将gcs_to_gcs导入为-

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

我可以导入此文件,但不能导入gcp_sql_operator.

I am able to import this but not gcp_sql_operator.

推荐答案

自Airflow gcp_sql_operator.py及其依赖项复制到Composer dags文件夹中. com/composer/docs/how-to/using/installing-python-dependencies#install-local"rel =" noreferrer>此处.

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.

这篇关于Cloud Composer中没有名为'gcp_sql_operator'的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆