https://dagster.io/ logo
Title
v

Vivek Gandhi

04/18/2023, 1:05 PM
Hi there, I've looked through documentation but haven't found an answer – any help would be appreciated. I have 2 pipeline files and I would like to import the output of an asset job from pipeline_1 to use in pipeline_2. Is this possible?
t

Tim Castillo

04/18/2023, 1:13 PM
How are you defining the pipelines? If you de-couple the concept of a job from the assets made from it, use SourceAssets to make them aware of assets across modules, and then define jobs at a separate level, while allowing you to keep your job definitions as they already were.
v

Vivek Gandhi

04/18/2023, 2:03 PM
perfect, thank you
t

Tim Castillo

04/18/2023, 2:05 PM
If you don't want to use source assets, you can also explicitly declare the inputs of an asset using the
ins
argument of the
@asset
decorator, like here: https://github.com/dagster-io/biweekly-demo/blob/a71c0b7e6bbf94b2929e2fba635633fe7b2a8a82/my_project/assets/forecasting/forecasting.py#L11
v

Vivek Gandhi

04/18/2023, 2:33 PM
Interesting, is there an advantage of using ins?
👍 1
@Tim Castillo is there documentation on ins? not sure what the arguments are referencing
t

Tim Castillo

04/20/2023, 6:46 PM
The benefit of
ins
is being able to access assets from other modules explicitly. Here's a simple example on how to use: https://github.com/dagster-io/biweekly-demo/blob/a71c0b7e6bbf94b2929e2fba635633fe7b2a8a82/my_project/assets/forecasting/forecasting.py#L11 It uses
ins
to grab the asset
ben/continent_population
from the
population
module.