Joh*_*ine 1 python google-cloud-storage google-cloud-datastore google-cloud-platform airflow
所以我在气流上运行这个操作员
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
)
Run Code Online (Sandbox Code Playgroud)
当我运行这个时,我收到一个错误
"error": "invalid_scope",
"error_description": "\u0026quot;https://www.googleapis.com/auth/devstorage.read_write\u0026quot; is not a valid audience string
Run Code Online (Sandbox Code Playgroud)
有没有人知道如何在气流上运行此运算符?
小智 5
听起来像缺少依赖.您应该能够使用以下命令安装GCP挂钩和运算符:
pip install apache-airflow[gcp_api]
Run Code Online (Sandbox Code Playgroud)
有关详细信息,请参阅此页面:https://airflow.apache.org/installation.html
| 归档时间: |
|
| 查看次数: |
951 次 |
| 最近记录: |