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

Eric Larson

06/16/2022, 5:36 PM
Hi I have a question about when you would use
build_assets_job
vs
define_assets_job
?
👍 1
s

sandy

06/16/2022, 6:00 PM
You should always use
define_asset_job
.
build_assets_job
is an earlier API that we still use internally.
Did you find the latter in documentation?
e

Eric Larson

06/16/2022, 6:05 PM
I was having a problem with a schedule and
unresolvedAssetDefinition
and in this post from yesterday it was mentioned
build_asset_definition
would give you resolved asset def https://dagster.slack.com/archives/C01U954MEER/p1655352716872389?thread_ts=1655238813.234129&cid=C01U954MEER
specifically the error is
AttributeError: 'UnresolvedAssetJobDefinition' object has no attribute 'run_request_for_partition'
What is best way to yield run request for static partitions in a schedule?
s

sandy

06/16/2022, 6:37 PM
Ah - that is a gap. We will make it so that the object returned by
define_asset_job
has a
run_request_for_partition
method. In the mean time, the following should work as a workaround:
Copy code
return RunRequest(run_key=..., tags={"dagster/partition": <your partition key>, "dagster/partition_set": "<your job name>_partition_set"})
e

Eric Larson

06/16/2022, 7:31 PM
that worked thanks
2 Views