Hi there, I want to ask if the following is suppor...
# ask-community
m
Hi there, I want to ask if the following is supported by DAGster: • In dagster integration with dbt, can a python asset be an upstream asset to dbt one? Meaning that dbt model depend on a dagster defined asset? • Can two repositories share the same asset folder? So that if they use the same asset, dagster can pick up on this dependency?
e
for question 1, we struggled with this as well but it will work if the upstream task has the same key as the model in dbt. For example, if are using dbt external tables, your upstream task should be named the same as the external table and then dagster will automatically recognize the connection. This means you may need to set the
key_prefix
on the upstream model so that it matches the external table’s source.
❤️ 1
y
question 1: yes, see details in https://github.com/dagster-io/dagster/issues/9575 cc@owen
❤️ 1
s
• Can two repositories share the same asset folder? So that if they use the same asset, dagster can pick up on this dependency?
if it's a
SourceAsset
, it can be shared by multiple repositories. if it's created by
@asset
etc, it can only be in one repository. you can make a source asset from an non-source asset with the
to_source_assets
method
❤️ 1
m
Thank you all 😊
@sandy Does dagster understand the mapping between the asset and the source asset though? So if a repository reads from the output of another one and I want to make the materialization start from the first repository and then the other? I can't find an example for it.
s
Dagster will show the lineage across repositories, but there's not yet a way to launch a single run that materializes assets in two different repositories. If assets X and Y are in different repositories, and you want to materialize Y after X, you could set up a sensor that launches a run to materialize Y after it sees that X is materialized
m
@sandy Do you have any code example for cross repository sensor?I didn't find it in the docs
s
did you come across asset sensors in the docs? https://docs.dagster.io/concepts/partitions-schedules-sensors/sensors#asset-sensors. they work across repositories run-status sensors also work across repositories