Hi, I have a newbie question. I have an asset grou...
# ask-community
j
Hi, I have a newbie question. I have an asset group with 4 monthly partitioned assets with interdependencies. When I click
materialize all (4)
button and select a month where none of the 4 assets were previously materialized, it complains that
Upstream data Missing: 2022-07-01 cannot be materialized because upstream materializations are missing
How can I make Dagster materialize all 4 in the dependency order automatically?
y
Do you mind sharing your asset group or the code that specifies the dependency?
j
Sure
Copy code
# from pandas import DataFrame

from dagster import asset
from repo.partitions import monthly_partitions

@asset(partitions_def=monthly_partitions)
def asset1(context):
    <http://context.log.info|context.log.info>(
        f"Processing asset partition '{context.asset_partition_key_for_output()}' "
    )


@asset(partitions_def=monthly_partitions)
def asset2_partitioned(context, asset1):
    <http://context.log.info|context.log.info>(
        f"Processing asset partition '{context.asset_partition_key_for_output()}' "
    )
That was asset group 1, and below is group 2.
Copy code
# from pandas import DataFrame

from dagster import asset, SourceAsset, AssetKey
from repo.partitions import monthly_partitions
# from repo.assets.asset_grp1.asset_one import asset2_partitioned

# source_asset1 = SourceAsset(key=AssetKey("asset2_partitioned"))

@asset(partitions_def=monthly_partitions)
def asset_grp2_1(context, asset2_partitioned):
    <http://context.log.info|context.log.info>(
        f"Processing asset partition '{context.asset_partition_key_for_output()}' "
    )


@asset(partitions_def=monthly_partitions)
def asset_grp2_2_partitioned(context,asset_grp2_1):
    <http://context.log.info|context.log.info>(
        f"Processing asset partition '{context.asset_partition_key_for_output()}' "
    )
And finally this is the repository.py.
Copy code
from dagster import repository, with_resources

from .assets import asset_grp1_assets, asset_grp2_assets

all_assets = [*asset_grp1_assets,*asset_grp2_assets]



@repository
def ngls_repository():

    definitions = [
        all_assets

    ]

    return definitions
At first, I didn't have asset1 as a partitioned asset but Dagster didn't seem to like partitioned asset depending on an unpartitioned asset.
Okay. Here is what I just realized. When I first click to materialize all, I do get that error/warning message mentioned above. However, if I click the materialize button again, this time Dagster does materialize all assets.
So in my opinion, the error/warning message is a bit misleading.
s
hey @jasono - which version are you running? this is a bug that I believe we fixed recently: https://github.com/dagster-io/dagster/issues/9291
j
oh.. 1.0.4. Let me try to upgrade i. Thank you!!
@sandy