【问题标题】:Uploading File to GCS Bucket in Airflow在 Airflow 中将文件上传到 GCS 存储桶
【发布时间】:2019-10-03 04:05:26
【问题描述】:

我有一个 Airflow DAG,其中一个变量设置为 GCS 存储桶,如下所示:

bucket = 'customer_accounts'

当我运行我的 Airflow DAG 时,一切正常,一个 CSV 文件被上传到 customer_accounts 存储桶中。

现在,我想在 customer_accounts 存储桶中创建一个文件夹,并将 DAG 中的所有 CSV 文件发送到存储桶中的以下文件夹。

bucket = 'customer_accounts/canada'

但是,当我尝试使用 bucket = 'customer_accounts/canada' 运行我的 DAG 时,我收到一条无效存储桶名称的错误消息。你知道如何解决这个问题吗?

【问题讨论】:

  • bucket 仍然是 'customer_accounts' - 你应该在文件名中包含文件夹

标签: python google-cloud-storage airflow


【解决方案1】:

评论中提到,bucket还是'customer_accounts',Google Cloud Storage没有传统意义上的文件夹的概念,它们是文件名的一部分。您可以在这里了解更多信息https://cloud.google.com/storage/docs/gsutil/addlhelp/HowSubdirectoriesWork

【讨论】:

    猜你喜欢
    • 2022-10-09
    • 2022-11-04
    • 1970-01-01
    • 2021-10-24
    • 2020-09-17
    • 1970-01-01
    • 2023-01-22
    • 2023-02-10
    • 2020-01-24
    相关资源
    最近更新 更多