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

Jonny Mills

09/13/2022, 12:10 PM
👋 newb question. I’m trying to define config properly for an
asset_job
such that “load_date” is can be accessed by all assets in asset_job. I can’t find documentation how to define config with assets without an error being raised of improper configuration. This is non-working pseudocode that raises the improper configuration error.
Copy code
asset_job = define_asset_job(
    name="asset_job",
    selection="asset1*",
    partitions_def=daily_partition,
    config={
        "asset1": {
                "config": {
                    "load_date": "foo",
                }
            },
        },
)
Hoping for advice how to rework the config to have load_date be accessible for all assets in this asset_job
Looking thru https://docs.dagster.io/_apidocs/assets#dagster.define_asset_job but it doesn’t make it clear how to define a config variable that all assets can access in an asset job
o

owen

09/13/2022, 4:50 PM
hi @Jonny Mills! would it be correct to assume that the load_date you want to supply to all of these assets corresponds to the partition you're currently running the job for? If so, you can call
context.partition_key
inside of the asset, no need for separate config
🌈 1