https://dagster.io/ logo
Title
a

Arturs Stramkals

11/03/2021, 9:33 PM
I appear to be missing something about contexts. How do I combine a context and normal arguments within an op’s function signature? I guess the question is on what to supply to an op with a signature
def foo_op(context, bar)
.
y

yuhan

11/03/2021, 9:36 PM
in your job, you will just do:
foo_op(return_bar())
a

Arturs Stramkals

11/03/2021, 9:38 PM
I’m not sure I can imagine it working like that, I’m combining
bar
input with context data
Oh, you mean that literally, in a syntactic sense.
How would that work if
foo_op
is a map over
return_bar
output?
Currently that looks like
fan_out_foo(baz).map(foo_op)
, with the issue being my confusion over launchpad asking me to define
bar
in config, though typing that out makes me wonder why I ever thought it would actually work like that.
Ah ok I think the problem actually was in me missing the difference between
context
and
initial_contet
.
y

yuhan

11/03/2021, 10:20 PM
did switching to
context
work?
a

Arturs Stramkals

11/03/2021, 10:21 PM
Indeed, no code adjustments other than that were required. I was unaware that
context
and
init_context
are reserved keywords with different meanings.
Apologies for distracting with this!
y

yuhan

11/03/2021, 10:33 PM
no worries! glad it works now