[英]Uploading a file to Google Bucket from local system using Airflow - Python
所以我在气流上运行这个运算符
from airflow.contrib.operators.file_to_gcs import FileToGoogleCloudStorageOperator
gcp_operator = \
FileToGoogleCloudStorageOperator(
task_id='gcp_task',
src='/Users/john/Documents/tmp',
dst='gs://constantine-bucket',
bucket='constantine-bucket',
google_cloud_storage_conn_id='DataScience',
mime_type='Folder',
dag=dag
)
当我运行它时,我得到一个错误
"error": "invalid_scope",
"error_description": "\u0026quot;https://www.googleapis.com/auth/devstorage.read_write\u0026quot; is not a valid audience string
有谁知道如何在气流上运行该操作员?
听起来像是缺少依赖项。 您应该能够使用以下方法安装GCP挂钩和运算符:
pip install apache-airflow[gcp_api]
有关更多信息,请参阅以下页面: https : //airflow.apache.org/installation.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.