https://dagster.io/ logo
#ask-community
Title
# ask-community
m

Menna ElMesalmy

09/08/2022, 2:41 PM
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

Eric Goddard

09/08/2022, 5:21 PM
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

yuhan

09/08/2022, 8:48 PM
question 1: yes, see details in https://github.com/dagster-io/dagster/issues/9575 cc@owen
❤️ 1
s

sandy

09/08/2022, 8:57 PM
• 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

Menna ElMesalmy

09/11/2022, 11:35 AM
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

sandy

09/11/2022, 6:09 PM
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

Menna ElMesalmy

09/13/2022, 4:15 PM
@sandy Do you have any code example for cross repository sensor?I didn't find it in the docs
s

sandy

09/13/2022, 6:00 PM
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
2 Views