Hello, Is there any way to define a PartitionMappi...
# ask-community
m
Hello, Is there any way to define a PartitionMapping for a dbt asset?
dagster bot responded by community 1
a
Both asset load functions include arguments that can be used to pass partitions definitions and variables mappings: https://docs.dagster.io/_apidocs/libraries/dagster-dbt#dagster_dbt.load_assets_from_dbt_project
m
PartitionsDefinitions, yes, but PartitionMapping, I don’t see any way. For example, how to pass config for LastPartitionMapping, which is usually done something like this:
Copy code
from dagster import DailyPartitionsDefinition, TimeWindowPartitionMapping, AssetIn, asset

partitions_def = DailyPartitionsDefinition(start_date="2020-01-01")

@asset(partitions_def=partitions_def)
def asset1():
    ...

@asset(
    partitions_def=partitions_def,
    ins={
        "asset1": AssetIn(
            partition_mapping=LastPartitionMapping()
        )
    }
)
def asset2(asset1):
    ...