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

SVG does not capture dependency correctly, but D3 does #2889

Closed
tashrifbillah opened this issue Jan 30, 2020 · 3 comments
Closed

SVG does not capture dependency correctly, but D3 does #2889

tashrifbillah opened this issue Jan 30, 2020 · 3 comments

Comments

@tashrifbillah
Copy link
Contributor

Description

SVG graph (incorrect): missing link between TaskB and D

image

D3 graph (correct): see the link between TaskB and D
image

Way to reproduce

python svgVsd3_issue.py

svgVsd3_issue.py

from luigi import build, Task, LocalTarget
from luigi.util import requires

class TaskA(Task):

    def run(self):
        with open('/tmp/a.txt','w') as f:
            f.write('a')


    def output(self):
        return LocalTarget('/tmp/a.txt')

@requires(TaskA)
class TaskB(Task):

    def run(self):
        with open('/tmp/b.txt', 'w') as f:
            f.write('b')

    def output(self):
        return LocalTarget('/tmp/b.txt')


@requires(TaskB)
class TaskC(Task):

    def run(self):
        with open('/tmp/c.txt', 'w') as f:
            f.write('c')

    def output(self):
        return LocalTarget('/tmp/c.txt')


@requires(TaskC,TaskB)
class TaskD(Task):

    def run(self):
        with open('/tmp/d.txt', 'w') as f:
            f.write('d')

    def output(self):
        return LocalTarget('/tmp/d.txt')


if __name__=='__main__':
    build([TaskD()])
    

Is there suggestion about fixing it or is it a bug?

@tashrifbillah
Copy link
Contributor Author

Hi @ihowell, did you experience this before?

@ihowell
Copy link

ihowell commented Feb 1, 2020

I haven't worked with the web view before, but from what you're showing, it looks like those graphs are intended for two different things.

The second graph (that you labeled correct) is for directly showing and exploring the dependency graph.

The first image looks like it is purely for showing what order the tasks will be run in with topological ordering.

Suppose you also had a task E that was required by C and task E requires task A. The second graph would show the dependency graph with B and E on the same level, with both being required by C and requiring A. However, the order in which they execute doesn't matter, so Luigi needs to pick an ordering and that order would show up in the first graph.

@Tarrasch
Copy link
Contributor

Tarrasch commented Mar 4, 2020

To me it looks like a bug, but not so important one really in this case as that dependency doesn't since you depend on something implicitly forcing that dependency order anyway.

I feel it's clear the issue is that since it's a straight line you just can't see the dependency edge. :)

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

No branches or pull requests

3 participants