def METHOD_NAME():
    partitions = [
        "apple",
        "banana",
        "cantaloupe",
    ]
    partitions_def = DynamicPartitionsDefinition(name="fruits")
    @asset(partitions_def=partitions_def)
    def dynamic1(context):
        return 1
    @asset
    def unpartitioned(context, dynamic1):
        assert set(context.asset_partition_keys_for_input("dynamic1")) == set(partitions)
        return 1
    with instance_for_test() as instance:
        instance.add_dynamic_partitions(partitions_def.name, partitions)
        for partition in partitions[:-1]:
            materialize([dynamic1], instance=instance, partition_key=partition)
        materialize([unpartitioned, dynamic1], instance=instance, partition_key=partitions[-1])