boto3 - Airflow 中的 S3Hook : no attribute 'get_credentials'

标签 boto3 airflow

我在 https://github.com/apache/incubator-airflow/blob/master/airflow/operators/s3_to_redshift_operator.py 使用 s3_to_reshift_operator执行时出现以下错误:

AttributeError: 'S3Hook' object has no attribute 'get_credentials'

看起来我的环境中使用的底层 S3Hook 与存储库中使用的不同。我该如何解决这个问题?我尝试升级 Airflow,但它没有解决我的问题。

最佳答案

好的,所以我认为您的问题是您使用的是 master 分支中的 s3_to_redshift 运算符(根据您的评论),它与 1.9 版本的 s3 Hook 不兼容。 s3 钩子(Hook)使用 aws 钩子(Hook)作为其基类,它不公开 1.9 中的 get_credentials 方法。它在 master 中。

关于boto3 - Airflow 中的 S3Hook : no attribute 'get_credentials' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51292260/

相关文章:

amazon-web-services - 从 CloudFormation 模板生成代码(java、python 等)

amazon-web-services - 如何增加 boto3.s3.transfer 下载的 token 过期时间?

python - 通过将凭据作为参数传递,使用 boto3 从 S3 Bucket 下载文件

etl - 如何防止记录加密的 Airflow 变量?

deployment - 使用 Airflow 进行零停机部署

python - 为什么 AWS SageMaker 创建 S3 存储桶

python-2.7 - aws boto3 客户端 Stubber 帮助 stub 单元测试

python - Airbnb Airflow 与 Apache Nifi

python - GCP Apache Airflow - 如何从私有(private)存储库安装 Python 包并在 DAG 上导入?

python - Google Cloud Composer BigQuery Operator - 获取作业 API HTTPError 404