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

Charles Leung

06/17/2022, 6:31 PM
Hey dagster team - I'm trying the following code after upgrading to 0.15.0:
Copy code
# Run config no longer works from passing it in. Must use launch pad
run_config_path = dagster.file_relative_path(
    __file__, os.path.join(".", "run_config", "vocational_assets_job.yaml")
)
config = dagster.config_from_files([run_config_path])
vocational_assets_job = dagster.build_assets_job(
    assets=[*extract_assets, *load_assets, *transform_assets],
    name="vocational_assets_job",
    config=config,
)
However, the config doesn't work and it still requires me to pass in via launchpad. Whats the best way to set a default config?
Just to clarify using build_assets_job worked fine before on 0.14.3 and i'm passing it in the same way ~
c

claire

06/17/2022, 7:00 PM
Hi Charles. In 0.15.0, we've switched to defining asset jobs via
define_asset_job
instead of
build_assets_job
in order to allow asset definitions to live directly on repositories. You can rewrite your job definition as follows:
Copy code
vocational_assets_job = define_asset_job("vocational_assets_job", config=config).resolve(
    [my_asset], source_assets=[]
)
c

Charles Leung

06/17/2022, 7:00 PM
Ah thank you! i'll give that a shot
c

claire

06/17/2022, 7:01 PM
If you add your asset job to a repository, you can directly just write
Copy code
vocational_assets_job = define_asset_job("vocational_assets_job", config=config)
and dagster will make the resolve call for you
c

Charles Leung

06/17/2022, 7:01 PM
😄 appreciate the fast turnaround
🎉 1
Hey @claire! I gave it a shot but unfortunately i'm still getting the same error when i click materialize:
Copy code
vocational_assets_job cannot be executed with the provided config. Please fix the following errors:

Missing required config entry "resources" at the root. Sample config for missing entry: {'resources': {'bigquery': {'config': {'dataset': '...'}}, 'gcs': {'config': {'gcs_bucket': '...'}}}}
Even though it's configured as you listed - config is a dictionary like this:
Copy code
{'resources': {'gcs': {'config': {'gcs_bucket': 'my-bucket', 'gcs_prefix': 'my-prefix'}}, 'bigquery': {'config': {'project': {'env': 'GCP_PROJECT'}, 'dataset': 'my-dataset'}}}}
c

claire

06/17/2022, 8:08 PM
Oh I see, you're seeing this error from the materialize button. It seems there is a bug in passing predefined config on your job to display in Dagit in the launchpad modal. I'll file an issue, for now you you can execute from the launchpad (and this will prepopulate the config from your yaml correctly).
❤️ 1
c

Charles Leung

06/17/2022, 8:09 PM
Thank you so much!
🎉 1
c

claire

06/17/2022, 8:09 PM
@Dagster Bot issue Config on asset job doesn't populate in materialize launchpad modal
d

Dagster Bot

06/17/2022, 8:09 PM
s

sandy

06/17/2022, 8:26 PM
@sean - mind taking a look?
s

sean

06/17/2022, 9:12 PM
looking into it