Will Holley
01/12/2023, 9:26 PM@asset
def bar(context):
# materialize an asset ...
@asset(config_schema={"bar":str})
def foo(context) -> Output[str]:
return Output(context.op_config['bar'])
exec_config = { "execution": { "config": { "start_method": {"forkserver": {} } } } }
job = define_asset_job(
"foo_job",
selection=[foo],
config=ConfigMapping(config_fn=lambda run_config: {**run_config, **exec_config}),
executor_def=multiprocess_executor
)
@asset_sensor(name="foo_sensor", job=job, asset_key="bar")
def foo_sensor(context, event):
yield RunRequest(run_config={ "ops": { "foo": { "config": { "bar": "baz" } } } } )
defs = Definitions(sensors=[foo_sensor], assets=[foo])
My job successfully enqueues and executes foo
but I am unsure whether exec_config
is concatenated and read. Clicking "view tags and config" in Dagit's Run detail view only shows the op config.
Can anyone confirm whether my approach is either correct or incorrect?sandy
01/13/2023, 2:53 AMcontext.op_config
inside your asset function.Will Holley
01/20/2023, 4:56 PM