# ask-community

Luke Dziurzynski

08/06/2023, 10:55 PM
I'm very confused with dynamic partitions. I have one asset that returns a dataframe, and want to iterate over the values of that column to run at most one request for each unique value in that column. Currently I have:
Copy code
def users() -> pd.DataFrame:
    return pd.read_csv("./data/users.csv").head(4)

def user_sensor(context: SensorEvaluationContext, asset_event: EventLogEntry):
    yield RunRequest(partition_key=asset_event.asset_materialization.metadata["partition_key"])
It is very unclear what I'm supposed to do next. I have been hopping around between documentation for sensors, asset sensors, @claire's slack messages, context.cursor, dynamic partitions, and the dynamic partitions example from github and am suuuuuper lost. What do I do next to run a function that receives that new dynamic partition value and writes an asset?

Tim Castillo

08/07/2023, 4:17 PM
Hi! Sorry the experience has you feeling this way, and I appreciate your feedback. Once you've yielded the run request, the assets the
asset will kick off a run and you can access the run's partition key with `
Copy code
`, as you would with other partitioned assets. At that point, it's up to the user to decide what the logic is to use that information about the partition themselves. ie. using that key query a database or upsert a record somewhere.