https://dagster.io/ logo
#integration-dbt
Title
# integration-dbt
p

Pablo Beltran

03/13/2023, 8:38 PM
Hey there! I am trying to use load_assets_from_dbt_project to load views and tables separately (calling load_assets_from_dbt_project with a selector for view and then again with a selector for tables). When I do this it doesn't seem to apply the key_prefix to the dependencies between a table and a view so I end up with the view asset, the table asset, and then the table asset it pointing to a separate asset that has the same name as the vie but without the key prefix. Is there some setting to fix this?
o

owen

03/14/2023, 5:36 PM
hi @Pablo Beltran! Before diving into the original question, I'm interested in the goal behind loading these subset separately, as it's likely there's an easier way to accomplish that goal.
p

Pablo Beltran

03/14/2023, 5:43 PM
Hey there i want to have different partition definitions for different assets
o

owen

03/14/2023, 9:11 PM
ah fair enough -- is the idea to make views unpartitioned and the tables partitioned (e.g.) daily? If the views are interspersed with the tables (i.e. you have table -> view -> table), I'd probably recommend just treating them all as partitioned just to keep things simple (even though it's not strictly accurate). but looking at it a bit more, I think the quick answer to your question would be to add the
source_key_prefix
to the
load_assets_from...
call, which matches the
key_prefix
argument.
p

Pablo Beltran

03/14/2023, 9:12 PM
We need to have daily tables and also some multi partion tables (and non partitioned views)
o

owen

03/14/2023, 9:13 PM
got it -- I think the source_key_prefix route is the way to go then
❤️ 1