I am trying to implement Software Defined assets o...
# ask-community
a
I am trying to implement Software Defined assets on my dbt cloud project. I have managed to render the assets on dagster but i am not able to materialize it (it gives me an error that i am using DBT cloud resource V2 everytime i try to materialize). I have used dbt cloud resource in my resource defs and as such was wondering if the Software Defined assets mechanism has put forth in place only for dbt-cli-resources (as mentioned in the github example in the docs). It would be great if anyone could provide any inputs on this. I am new to dagster and would really appreciate if anyone could clarify.
o
hi @Ashley Dsouza! Currently, dagster software-defined-assets do not support the dbt cloud resource, but this is something that we hope to add support for within the next few releases. For reference, what was your process for rendering the assets in dagster? Did you download the manifest.json file from dbt cloud, then use
load_assets_from_dbt_manifest
?
a
Hi, yes i used
load_assets_from_dbt_manifest
for getting the asset definitions. This was available to me through the DbtCloudResourceV2 class. This means that it limited my asset definition to just one predefined run of DBT because i had to specify the runID for the manifest file.
o
I see, that totally makes sense -- getting that manifest file and keeping it up to date is definitely more annoying when using dbt Cloud with SDAs (as with the CLI, you can always just execute the project locally), and in the initial implementation of this feature, this would be left up to the user to some extent. Using the resource to get that file is a good solution, and one slight improvement over your method would be to first query the dbt Cloud API for the most recent run (https://sourcegraph.com/github.com/dagster-io/dagster/-/blob/python_modules/libraries/dagster-dbt/dagster_dbt/cloud/resources.py?L177), and then use that run id for the
get_manifest()
function
a
Awesome. Thanks for this information!