如何解决luigi的Task输出功能如何覆盖文件?
当我在luigi中有一个任务时:
@requires(ClassB)
class ClassA(luigi.Task):
def output(self):
filepath = os.path.join(
self.output_directory(),".uploaded")
return luigi.LocalTarget(filepath)
def run(self):
self.output().makedirs()
with self.output().open('w') as output:
pass
此处输出显示将要创建文件xxx.uploaded
。
第一次运行良好并创建了文件
但是,如果在必需的任务中“ ClassB”还生成了另一个文件,并且当再次调用luigi失败时,我手动删除了该文件
FileExistsError: [WinError 183] That file alreadt exists
and it shows me that `XXX.uploaded``` is created as a copy but cannot be copied to the output location.
如何使输出文件重新创建?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。