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

Binoy Shah

04/13/2023, 2:05 PM
Hi we have a mono-repo style code base with different packages working as differnt asset + Repositories ( we are still using repositories ) One of our assets is in package
workflows.inventories.assets
and it is managed within its own definitions and materialization flows. But this asset is a re-usable asset and would like to pass in as input to many other downstream assets in different packages/modules. How do I enable sharing of such assets. if I have
inventories
asset in one package, if it were in same code file, the consumer of inventories would just use it by calling
Copy code
def inventory_consumer(inventories):
  pass
but because inventories is in different package, I am currently getting error
Copy code
Input asset '["inventories"]' for asset '["consolidated_sales"]' is not produced by any of the provided asset ops and is not one of the provided sources
What are my options ?
dagster bot responded by community 1
v

Vinnie

04/13/2023, 2:47 PM
b

Binoy Shah

04/13/2023, 2:59 PM
Is there a utility method that just converts an asset to source asset, similar to utility methods like
load_assets_from_package_module
something like
load_as_source_asset
explicitly defining a
SourceAsset
breaks my cohesiveness to the actual asset, leaving it for string manipulation values, that make it more fragile and breakage prone
v

Vinnie

04/13/2023, 3:01 PM
You should be able to use
<http://AssetsDefinition.to|AssetsDefinition.to>_source_asset()
https://docs.dagster.io/_apidocs/assets#dagster.AssetsDefinition.to_source_asset
b

Binoy Shah

04/13/2023, 3:01 PM
Ah ! Thank you
3 Views