Hey there! I am trying to use load_assets_from_db...
# integration-dbt
p
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
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
Hey there i want to have different partition definitions for different assets
o
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
We need to have daily tables and also some multi partion tables (and non partitioned views)
o
got it -- I think the source_key_prefix route is the way to go then
❤️ 1