dagster
dagster copied to clipboard
[ui] Resource config scaffolding in launchpad does not reflect asset selection
trafficstars
The pre-filled config input you are presented with when you attempt to materialize a subset of assets includes resources that are not associated with any asset in the selection. Instead they are sourced from all assets in the group/job.
Repro:
from dagster import (
asset,
Definitions,
AssetExecutionContext,
)
from dagster._config.pythonic_config.resource import ConfigurableResource
from dagster._core.definitions.unresolved_asset_job_definition import define_asset_job
class Resource1(ConfigurableResource):
val1: int
class Resource2(ConfigurableResource):
val2: int
class Resource3(ConfigurableResource):
val3: int
class Resource4(ConfigurableResource):
val4: int
@asset
def foo(context: AssetExecutionContext, res1: Resource1):
...
@asset
def bar(context: AssetExecutionContext, res2: Resource2):
...
asset_job = define_asset_job("asset_job", [foo, bar])
defs = Definitions(
assets=[foo, bar],
jobs=[asset_job],
resources={"res1": Resource1(val1=1), "res2": Resource2(val2=2), "res3": Resource3(val3=3)},
)
Now go to default asset group, click foo and shift-click materialize. You will see that the scaffolding includes config for res2 even though it is not associated with the selection (just foo):
cc @salazarm
This makes launchpad difficult to use, if you have many many resources :) I hope this can be picked up soon