Am I right in thinking that if using `define_asset...
# ask-community
a
Am I right in thinking that if using
define_asset_job
to create a job to materializes assets, I need to select all prerequisite assets rather than just the one I want? It would be nice if I could ask for only a specific asset (the one I’m interested in), and then dagster could figure out which upstream ones need to be computed based on knowledge of the dependencies. Is this behaviour possible at all?
dagster bot responded by community 1
t
define_asset_job supports a selection param which can be an
AssetSelection
. AssetSelection has an upstream method that I think would solve your use case. Going off this example in the docstring it seems like you could do something like
Copy code
AssetSelection.keys("asset_abc").upstream()
where
asset_abc
is the key for the single asset you are interested in and pass that into the
selection
param of
define_asset_job
a
Ah, I’d noticed the
selection
param and
AssetSelection
, but hadn’t noticed the
upstream
method. I’ll give that a try - thanks!