3
我创建与路易吉数据管道,我试图将处理过的数据S3桶直接写。我使用的代码是: 路易吉写文件直接到S3
import luigi
from luigi.s3 import S3Target, S3Client
class myTask(luigi.Task):
def requires(self):
return otherTask()
def output(self):
client = S3Client('ACCESS_KEY', 'SECRET_KEY')
return S3Target('s3.amazonaws.com/mybucket/myfolder/myfile.tsv', client=client)
def run(self):
fo = self.output().open('w')
with self.input().open('r') as f:
data = dosomething_to_input(f)
fo.write(data)
fo.close()
我运行该脚本后,我得到了错误:
S3ResponseError: S3ResponseError: 405 Method Not Allowed
我们能直接写文件到S3斗?