Arvind Narayan
08/25/2023, 3:35 PM@asset
def hackernews_top_story_ids(config: FileAssetConfig)-> str:
@asset
def hackernews_top_stories(context: AssetExecutionContext,
hackernews_top_story_ids: str,
config: MultiFrameAssetConfig,
) -> pd.DataFrame:
materialize(
assets = [hackernews_top_story_ids, hackernews_top_stories],
resources = {
'io_manager': datastore_io_manager()
},
run_config = RunConfig(
ops = {
'hackernews_top_story_ids': FileAssetConfig(name="hackernews_top_story_ids",
workspace="dagster-test"),
'hackernews_top_stories': MultiFrameAssetConfig(name="hackernews_top_stories",
workspace="dagster-test",
concat_dim="story_id"),
}
)
)
In the materialization of the first step, I am able to access the FileAssetConfig object as context.step_context.op_config
. How can I get the same config in the second step? context.upstream_output...???
Arvind Narayan
08/25/2023, 4:21 PMjamie
08/25/2023, 4:28 PMclass SharedConfig(Config):
foo: str
bar: str
class FirstConfig(Config):
shared_config: SharedConfig
baz: str
class SecondConfig(Config):
shared_config: SharedConfig
qux: str
shared_config = SharedConfig(foo="hello", bar="world")
materialize(
assets=[...],
run_config=RunConfig(ops={"first_op": FirstConfig(shared_config=shared_config, baz="!")
)
Arvind Narayan
08/28/2023, 4:28 PM