Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicated outputs of luigi.task.flatten_output #3106

Closed
starhel opened this issue Sep 9, 2021 · 1 comment · Fixed by #3174
Closed

Duplicated outputs of luigi.task.flatten_output #3106

starhel opened this issue Sep 9, 2021 · 1 comment · Fixed by #3174
Labels

Comments

@starhel
Copy link
Contributor

starhel commented Sep 9, 2021

Description
luigi.task.flatten_output does not detect "diamond" problem. If some task is required by more than one wrapper task, its output is duplicated in returned list.

Simple reproduction:

import luigi
from luigi.task import flatten_output
from luigi.util import requires


class TestTask(luigi.ExternalTask):
    def output(self):
        return luigi.LocalTarget("file.txt")
    

@requires(TestTask)
class WrapperOne(luigi.WrapperTask):
    pass
        

@requires(TestTask)
class WrapperTwo(luigi.WrapperTask):
    pass
        

@requires(WrapperOne, WrapperTwo)
class WrapperMaster(luigi.WrapperTask):
    pass
        
        
print([target.path for target in flatten_output(WrapperMaster())])

Actual output (luigi==3.0.3): ['file.txt', 'file.txt']
Expected output: ['file.txt']

@stale
Copy link

stale bot commented Jan 9, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If closed, you may revisit when your time allows and reopen! Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant