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 (将#修改为@)