如何让 python 包“awswranger”接受自定义“endpoint_url”

Dav*_*rks 3 amazon-s3 amazon-web-services boto3 aws-data-wrangler

我正在尝试使用 python 包awswrangler访问非 AWS S3 服务。

AWS Data Wranger 文档指出您需要创建一个boto3.Session()对象。

问题是boto3.client()支持设置endpoint_url,但boto3.Session()不支持(文档此处)

在我以前的使用中,boto3我总是client因为这个原因而使用 。

有没有办法创建一个boto3.Session()自定义端点endpoint_url或以其他方式配置awswrangler以接受自定义端点?

Dav*_*rks 5

我终于找到了配置awswrangler

import awswrangler as wr

wr.config.s3_endpoint_url = 'https://custom.endpoint'
Run Code Online (Sandbox Code Playgroud)