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

Samuel Shi

07/18/2023, 5:29 PM
I have a job with a config that I want to pass to an asset:
Copy code
def process_slack_alert(context: OpExecutionContext, config: SlackAlertConfig) -> None:
    if condition: yield AssetMaterialization(asset_key="vote_count_slack_alert", description="Sending vote count update to Slack")
    else: (materialize different asset with config data)
How would I pass this config data to a second asset that I would like to materialize? I only want the process_slack_alert asset to be tied to the job, because I want to conditionally materialize between two assets
c

claire

07/18/2023, 10:15 PM
Hi Samuel. Config cannot be passed to a job as a whole, it can only apply to a specific op/asset. I think you'll need to pass the same config to each of the two assets (it will be ignored if the asset doesn't execute)