dagster icon indicating copy to clipboard operation
dagster copied to clipboard

[ui] Resource config scaffolding in launchpad does not reflect asset selection

Open smackesey opened this issue 1 year ago • 2 comments
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):

image

smackesey avatar Apr 19 '24 14:04 smackesey

cc @salazarm

smackesey avatar Apr 19 '24 14:04 smackesey

This makes launchpad difficult to use, if you have many many resources :) I hope this can be picked up soon

ion-elgreco avatar May 29 '24 17:05 ion-elgreco