Stephen Bailey
03/03/2023, 2:07 PMasset_selection
. The basic gist is: if at least one asset in the graph requires manual config, then the evaluated sensor job (from the launchpad) will never be launchable from the launchpad. However, it will run as expected when the sensor triggers it. Example in 🧵Stephen Bailey
03/03/2023, 2:08 PMfrom dagster import asset, sensor, Definitions, AssetSelection, RunRequest, Definitions
# one asset requires config, the other does not
@asset(config_schema={"foo": str})
def foo(context):
return context.op_config["foo"]
@asset()
def bar(context):
return "bar"
# the sensor should yield an asset run just of bar, which requires no config
@sensor(asset_selection=AssetSelection.assets(bar))
def baz():
yield RunRequest(run_key="foo")
defs = Definitions(
assets=[foo, bar],
sensors=[baz],
)
If you run the baz
sensor normally, it will yield of a run of bar
correectly. But if you evaluate in the launchpad, the resulting run will not be launchable, because foo
is missing config.Stephen Bailey
03/03/2023, 2:09 PMVinnie
03/03/2023, 3:15 PMsandy
03/03/2023, 10:34 PMchris
03/06/2023, 5:53 PM