Charles Lariviere
12/16/2021, 2:55 PMconfig_schema
(and not Ins
)? Since we can configure Op inputs in run configuration, I was expecting to also be able to do that with the Configured API, but I’m getting errors that make me think it isn’t the case.config_schema
and what belongs as an In
. It seems like In
gives the most flexibility (can pass the output from another Op, while config can’t)
We have a database resource with methods such as create_schema(name, replace, **options)
, create_table(name, columns, **options)
, etc. for which I want to create matching Ops that can be reused in any job we write.
In some jobs, I would want some arguments to be provided by other Op’s outputs, while in other jobs I would want them to be hard-coded within the job definition and not configurable. I understand this is what the Configured API is for — though again, it doesn’t seem like it can be used for Ins
🤔max
12/16/2021, 5:27 PMchris
12/16/2021, 11:41 PM@op
def my_op_with_in(x):
...
@graph(config=ConfigMapping(config_fn=lambda outer: outer, config_schema=Permissive())
def my_graph():
my_op_with_in()
my_graph.configured({"ops": {"my_op_with_in": {"inputs": ...}}})
You are correct that the configured api can only be used for fields defined in the config_schema
of an op
. The idea there is that being able to configure inputs in advance becomes tricky with error messaging and control flow.
Ins
are usually used to represent some sort of upstream dagster dependency, while configuration represents some hyperparameter to the computation. Your use case makes a ton of sense though, and exposes some tricky ambiguities between the functionality of both.Charles Lariviere
12/16/2021, 11:54 PMArslan Aziz
07/21/2022, 5:33 PMdagster.core.errors.DagsterInvalidDefinitionError: Only graphs utilizing config mapping can be pre-configured. The graph "image_percy_graph" does not have a config mapping, and thus has nothing to be configured.
My graph consists of ops that have Ins
and I'm trying to preconfigure the Ins
using the configured API on the graph.chris
07/21/2022, 5:36 PM@op
def my_op_with_in(x):
...
@graph(config={"ops": {"my_op_with_in": {"inputs": ...}}})
def my_graph():
my_op_with_in()
Arslan Aziz
07/21/2022, 6:13 PMDagsterInvalidConfigError
when trying to launch the job from the Dagit UI. The error string is Error 1: Received unexpected config entries "['ops', 'resources']" at the root. Expected:
where the Expected
is a list of all the ops which I set the inputs
for in the graph config.chris
07/21/2022, 6:44 PMArslan Aziz
07/21/2022, 6:45 PMchris
07/21/2022, 6:45 PMArslan Aziz
07/21/2022, 6:47 PMops
of the same config, I've also included ops that take a config_schema
. Example in the config: {"ops": {"my_op_with_config": {"config": {...}}}
chris
07/21/2022, 6:48 PMArslan Aziz
07/21/2022, 6:53 PMchris
07/21/2022, 6:56 PMArslan Aziz
07/21/2022, 7:02 PMconfig
argument of to_job
); however, I'm still receiving the same error when I try to run the pipeline.
Thanks for looking into it. I've moved the resource config to the job level config (as thechris
07/21/2022, 7:04 PM"inputs": {
"disk_device_name": {"value": DISK_DEV}},
Arslan Aziz
07/21/2022, 7:06 PMchris
07/21/2022, 7:18 PMArslan Aziz
07/21/2022, 7:18 PM