https://dagster.io/ logo
#ask-community
Title
# ask-community
d

Davi

09/01/2022, 12:40 PM
Hey guys, The only functions that appear on the lineage are those inside the
@job
function ? If I call an
@op
inside an other
@op
, is there a way of showing it on the lineage? For example:
Copy code
@op
def action_1():
    return x

@op
def action_2():
    return y

@op
def gather_actions():
    action_1()
    action_2()

@job
def job()
    gather_actions()
In this ex, we can see only the
gather_actions()
on the Dasgter lineage.... But I want to show them on the lineage without having to:
gather_actions(action_1(), action_2())
. Thank you all!
j

jamie

09/01/2022, 1:03 PM
Hi @Davi this is probably just a typo in the code snippet, but one thing to note is that ops can't be called from within other ops. To set an ordering of ops, we use the
@graph
decorator.
Copy code
@graph
def gather_actions():
    action_1()
    action_2()
when I launch dagit and look at overview page of a job that contains a graph, I have a button to expand the job and see the ops within it
if you dont see that let me know!
d

Davi

09/01/2022, 1:07 PM
Hello @jamie, So... You are telling me that I can set a graph inside a job ? Isn't the job a graph with parameters ? Sorry for the dummy questions but I am a beginner with Dagster. :)
j

jamie

09/01/2022, 1:11 PM
no worries! graphs are a bit special, and the difference between graphs and jobs can be a bit subtle. you're right that a job is a graph with a set of parameters (like resource classes or values for config). you can put ops directly in a job. you can also choose to instead put your ops in a graph and then you can reuse that graph in multiple jobs. this lets you make several jobs from the same graph (for example if you want to vary config) or include a graph in multiple jobs (if you have a set of computation you want to reuse) so in your code snippet you could jump right to putting the ops in the final job and that would be equally correct
2 Views