https://dagster.io/ logo
#ask-community
Title
# ask-community
j

Jeremy

07/29/2022, 2:31 PM
so, i think this will run “this_dev_job” when a new asset is made in “telemetry”.“metrics”. but not sure how to get the partition info over to the job it needs to kick off. looking for docs on run_config for partitioned asset jobs.
Copy code
@asset_sensor(
    name='this_dev_sensor',
    asset_key=AssetKey(["telemetry", "metrics"]), 
    job="this_dev_job",
)
def this_dev_sensor(context, asset_event):
    yield RunRequest(
        run_key=context.cursor,
        run_config={}
    )
👀 1
🤖 1
o

owen

08/01/2022, 4:56 PM
hi @Jeremy! By "asset job", do you mean a job defined using
define_asset_job
? If so, you can do something like the following:
Copy code
this_dev_job = define_asset_job(...)

@asset_sensor(
    name='this_dev_sensor',
    asset_key=AssetKey(["telemetry", "metrics"]), 
    job=this_dev_job,
)
def this_dev_sensor(context, asset_event):
    desired_partition_key = # ...
    yield this_dev_job.run_request_for_partition(
        partition_key=desired_partition_key,
        # optional below 
        run_key=...,
        tags=...,
    )
j

Jeremy

08/01/2022, 4:58 PM
yup. this is basically what i did. thanks!
👌 1
2 Views