Thomas Tran
07/19/2023, 12:59 PMdagster dev -f locationA.py -f locationB.py
, I see the Global Asset Lineage shown in the attached image.
# locationA.py
import dagster as dg
@dg.asset
def loc_A_asset_1():
return "A1"
@dg.asset
def asset_2(loc_A_asset_1):
return "A2"
defs = dg.Definitions(
assets=[loc_A_asset_1, asset_2]
)
# locationB.py
import dagster as dg
@dg.asset
def loc_B_asset_1():
return "B1"
@dg.asset
def asset_2(loc_B_asset_1):
return "B2"
defs = dg.Definitions(
assets=[loc_B_asset_1, asset_2]
)
claire
07/19/2023, 10:19 PMclaire
07/19/2023, 10:21 PMasset_2
key? If these assets are persisting values to different locations, here are some ideas for how you can avoid key collisions:
• You could add a key_prefix
, which basically prepends the key with a certain value. I.e. team_1/asset
, team_2/asset
etc.
• You could assign a different name to one of the assetsThomas Tran
07/20/2023, 6:35 AMclaire
07/20/2023, 10:44 PMload_assets_from_package_module
methods accept a key_prefix
arg that you can use to auto-assign a key prefix to all the assets, if that helpsThomas Tran
07/24/2023, 11:38 AM